Expand description
ยงAES-256-CBC-HMAC-SHA256 operations
An extended construction of AES-256-CBC-HMAC-SHA256. It is used when an AES256-CBC-HMAC-SHA256 key is used for authenticated encryption in the context of COSE.
Structsยง
- Aes256
CbcHmac ๐Sha256 Aead - AES-256-CBC-HMAC-SHA256 authenticated encryption with associated data.
- Aes256
CbcHmac ๐Sha256 Aead Ciphertext - Aes256
CbcHmac ๐Sha256 Aead Nonce - A 128-bit AES-256-CBC-HMAC-SHA256 IV.
Constantsยง
- ENC_
KEY_ ๐SIZE - KEY_
SIZE ๐ - MAC_
DOMAIN_ ๐SEPARATOR - Domain separation label prefixed to the MAC input. It distinguishes this construction from the
legacy
Aes256CbcHmacSha256Encrypt-then-MAC construction, which MACsiv || ciphertextunder the same MAC sub-key, so that a tag produced by one construction can never be a valid tag for the other. - MAC_
KEY_ ๐SIZE - MAC_
SIZE ๐ - NONCE_
SIZE ๐
Functionsยง
- calculate_
mac_ ๐with_ aad - Computes the HMAC-SHA256 MAC over
MAC_DOMAIN_SEPARATOR || iv || len(data) || data || len(associated_data) || associated_data, where lengths are encoded as 8-byte big-endianu64s. - split_
to_ ๐subkeys - Splits the 64-byte composite key into zero-copy views over its encryption and MAC halves.
Type Aliasesยง
- Hmac
Sha256 ๐