Skip to main content

Module cipher

Module cipher 

Source
Expand description

AES-128-CBC encryption / decryption of SCS_17/SCS_18 DATA payloads.

§Spec: Annex D.5

  • DATA is always 0x80-padded (per super::pad::pad_data).
  • The CBC ICV is the one’s complement of the last MAC received from the other device.
  • Key is S-ENC.

Functions§

complement_icv
Annex D.5 ICV: one’s complement of the last MAC from the other side.
decrypt_data
Decrypt a DATA payload and strip the 0x80 padding.
encrypt_data
Encrypt a DATA payload with AES-128-CBC, applying the always-0x80 padding rule. s_enc is the session encryption key, iv is the complemented MAC of the last frame received from the other side.