suci

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PrefixIMSI     = "imsi-"
	PrefixSUCI     = "suci"
	SupiTypeIMSI   = "0"
	NullScheme     = "0"
	ProfileAScheme = "1"
	ProfileBScheme = "2"
)
View Source
const (
	ProfileAMacKeyLen = 32 // octets
	ProfileAEncKeyLen = 16 // octets
	ProfileAIcbLen    = 16 // octets
	ProfileAMacLen    = 8  // octets
	ProfileAHashLen   = 32 // octets
)

profile A.

View Source
const (
	ProfileBMacKeyLen = 32 // octets
	ProfileBEncKeyLen = 16 // octets
	ProfileBIcbLen    = 16 // octets
	ProfileBMacLen    = 8  // octets
	ProfileBHashLen   = 32 // octets
)

profile B.

Variables

View Source
var ErrorPublicKeyUnmarshalling = fmt.Errorf("failed to unmarshal uncompressed public key")

Functions

func Aes128ctr

func Aes128ctr(input, encKey, icb []byte) ([]byte, error)

func AnsiX963KDF

func AnsiX963KDF(sharedKey, publicKey []byte, encKeyLen, macKeyLen, hashLen int) []byte

func HmacSha256

func HmacSha256(input, macKey []byte, macLen int) ([]byte, error)

func ToSupi

func ToSupi(suci string, suciProfiles []SuciProfile) (string, error)

Types

type Suci added in v1.3.2

type Suci struct {
	SupiType         string // 0 for IMSI, 1 for NAI
	Mcc              string // 3 digits
	Mnc              string // 2-3 digits
	HomeNetworkId    string // variable-length string
	RoutingIndicator string // 1-4 digits
	ProtectionScheme string // 0-2
	PublicKeyID      string // 1-255
	SchemeOutput     string // hex string
}

type SuciProfile

type SuciProfile struct {
	ProtectionScheme string `yaml:"ProtectionScheme,omitempty"`
	PrivateKey       string `yaml:"PrivateKey,omitempty"`
	PublicKey        string `yaml:"PublicKey,omitempty"`
}

Jump to

Keyboard shortcuts

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