BALTECH SDK wrapper functions reference

§ aes_cbc_mac()

int aes_cbc_mac ( aes_ctx  ctx,
const unsigned char *  plaintext,
size_t  plaintext_len,
unsigned char  mac[AES_BLOCK_SIZE] 
)

Calculate CBC-MAC (Cipher Block Chaining Message Authentication Code).

Parameters
ctxAES context from aes_create_ctx()
plaintextInput data
plaintext_lenLength in bytes (must be multiple of AES_BLOCK_SIZE)
macInput: IV (16 bytes), Output: MAC (16 bytes)
Returns
AES_OK on success, AES_ERR_* on error
Note
mac is both input (IV) and output (MAC result)