Skip to main content

Module aes

Module aes 

Source

Constantsยง

AES_128_KEY_LEN
Length of an AES-128 key in bytes.
AES_192_KEY_LEN
Length of an AES-192 key in bytes.
AES_256_KEY_LEN
Length of an AES-256 key in bytes.
AES_BLOCK_LEN
AES_CBC_IV_LEN
The number of bytes for an AES-CBC initialization vector (IV)
AES_CFB_IV_LEN
The number of bytes for an AES-CFB initialization vector (IV)
AES_CTR_IV_LEN
The number of bytes for an AES-CTR initialization vector (IV)
AES_OFB_IV_LEN
The number of bytes for an AES-OFB initialization vector (IV)
MAX_CFB1_CHUNK_LEN ๐Ÿ”’
Bounds one AES_cfb1_encrypt call so the byte-to-bit conversion cannot overflow, which it would above usize::MAX / 8 = 512 MiB (on a 32-bit target). Mirrors MAXBITCHUNK in AWS-LCโ€™s crypto/decrepit/cfb/cfb.c.

Functionsยง

aes_cbc_decrypt ๐Ÿ”’
aes_cbc_encrypt ๐Ÿ”’
aes_cfb1_decrypt ๐Ÿ”’
aes_cfb1_encrypt ๐Ÿ”’
aes_cfb8_decrypt ๐Ÿ”’
aes_cfb8_encrypt ๐Ÿ”’
aes_cfb128_decrypt ๐Ÿ”’
aes_cfb128_encrypt ๐Ÿ”’
aes_ctr128_encrypt ๐Ÿ”’
aes_ecb_decrypt ๐Ÿ”’
aes_ecb_encrypt ๐Ÿ”’
aes_ofb128_encrypt ๐Ÿ”’
AES_ofb128_encrypt takes no direction argument: the keystream does not depend on the data, so OFB encryption and decryption are the same operation.
cfb1_cipher ๐Ÿ”’
iv is the feedback register and carries the state across chunks, so splitting the input does not change the result. AES_cfb1_encrypt serves both directions.
cfb1_cipher_in_chunks ๐Ÿ”’
Chunk length is a parameter so tests can reach the multi-chunk path.
decrypt_cbc_mode ๐Ÿ”’
decrypt_cfb_mode ๐Ÿ”’
decrypt_ctr_mode ๐Ÿ”’
decrypt_ecb_mode ๐Ÿ”’
decrypt_ofb_mode ๐Ÿ”’
encrypt_block ๐Ÿ”’
encrypt_cbc_mode ๐Ÿ”’
encrypt_cfb_mode ๐Ÿ”’
encrypt_ctr_mode ๐Ÿ”’
encrypt_ecb_mode ๐Ÿ”’
encrypt_ofb_mode ๐Ÿ”’