milenage

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K_LEN            = 16
	OP_LEN           = 16
	OPC_LEN          = 16
	SQN_LEN          = 6
	RAND_LEN         = 16
	AMF_LEN          = 2
	MAC_LEN          = 8
	RES_LEN          = 8
	SRES_LEN         = 4
	KC_LEN           = 8
	CK_LEN           = 16
	IK_LEN           = 16
	AK_LEN           = 6
	AUTN_LEN         = 16
	AUTS_LEN         = 14
	CIPHER_BLOCK_LEN = 16
)

Variables

This section is empty.

Functions

func CutAUTN

func CutAUTN(autn []byte) ([]byte, []byte, []byte)

AUTN = (SQNms ^ AK) || AMF || MAC-A

func CutAUTS

func CutAUTS(auts []byte) ([]byte, []byte)

AUTS = (SQNms ^ AK-S) || MAC-S

func GenerateAKAParameters

func GenerateAKAParameters(opc, k, rand, sqn, amf []byte) (ik, ck, xres, autn []byte, err error)

func GenerateAUTS

func GenerateAUTS(opc, k, rand, sqnms []byte) (auts []byte, err error)

func GenerateKeysWithAUTN

func GenerateKeysWithAUTN(opc, k, rand, autn []byte) (sqnhe, ak, ik, ck, res []byte, err error)

func GenerateOPc

func GenerateOPc(k, op []uint8) (opc []uint8, err error)

func GenerateOPcFromHex

func GenerateOPcFromHex(k, op string) (opc string, err error)

func ValidateAUTS

func ValidateAUTS(opc, k, rand, auts []byte) (sqnms []byte, err error)

Types

type MACFailureError

type MACFailureError struct {
	MACName     string
	ExpectedMAC []byte
	ExactMAC    []byte
}

func (*MACFailureError) Error

func (m *MACFailureError) Error() string

type ParameterLengthError

type ParameterLengthError struct {
	Name     string
	Exact    int
	Expected int
}

func (*ParameterLengthError) Error

func (e *ParameterLengthError) Error() string

Jump to

Keyboard shortcuts

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