mup

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SliceMs

func SliceMs(m1m2m3m4m5 [112]byte) (m1 []byte, m2 []byte, m3 []byte, m4 []byte, m5 []byte)

func WithLogs

func WithLogs()

WithLogs will enable verbose logs for this package(useful for debugging)

Types

type Input

type Input struct {
	// SHE module Unique ID as hex string
	UID string

	// ID of the secret key
	AuthID she.KeyID

	// secret key as hex string
	AuthKey string

	// ID of the slot to be updated
	ID she.KeyID

	// the new value of the key as hex string
	NewKey string

	// new value of the counter
	Counter uint32

	// key flags
	Flags ProtectionFlags
}

func Decode

func Decode(m1m2m3, authKey []byte) (*Input, error)

func (Input) Encode

func (in Input) Encode() (result [112]byte, err error)

Encode the memory update protocol data(M1, M2, M3, M4, M5).

type ProtectionFlags

type ProtectionFlags struct {
	// Enable write-protection
	Write bool
	// Enable boot-protection
	Boot bool
	// Enable debugger-protection
	Debugger bool
	// key usage: false=encryption/decryption, true=MAC generation/verification
	KeyUsage bool
	// Enable wildcard-protection
	Wildcard bool
}

func (ProtectionFlags) String

func (f ProtectionFlags) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL