Skip to main content

Module crypto

Module crypto 

Source
Expand description

AES-128 primitives, key derivation, cryptograms.

§Spec: Annex D.4

Session keys are derived by AES-128 encrypting fixed templates with the SCBK:

  • S-ENC = AES_SCBK([0x01, 0x82, RND.A[0..6], 0,0,0,0,0,0,0,0])
  • S-MAC1 = AES_SCBK([0x01, 0x01, RND.A[0..6], 0,0,0,0,0,0,0,0])
  • S-MAC2 = AES_SCBK([0x01, 0x02, RND.A[0..6], 0,0,0,0,0,0,0,0])

Cryptograms:

  • ClientCryptogram = AES_S-ENC(RND.A || RND.B)
  • ServerCryptogram = AES_S-ENC(RND.B || RND.A)

Structs§

SessionKeys
Derived session keys.

Functions§

aes128_decrypt
AES-128 decrypt of a single block.
aes128_encrypt
AES-128 encrypt of a single block.
client_cryptogram
ClientCryptogram = AES_S-ENC(RND.A || RND.B).
diversify_scbk_legacy
Legacy key diversification: SCBK = AES_MK( cUID || ~cUID ).
initial_rmac
Initial R-MAC = AES_S-MAC2( AES_S-MAC1( ServerCryptogram ) ).
server_cryptogram
ServerCryptogram = AES_S-ENC(RND.B || RND.A).

Type Aliases§

Block
128-bit AES block.