aes_sync_cbc_crypt

The AES-CBC block encryption/decryption length should be a multiple of 16 bytes.

int32_t aes_sync_cbc_crypt(
    struct aes_sync_descriptor * descr,
    const enum aes_action enc,
    const uint8_t * input,
    uint8_t * output,
    uint32_t length,
    uint8_t iv
)

Parameters

descr

Type: struct aes_sync_descriptor Struct *

The AES descriptor

enc

Type: const enum aes_action

AES_SYNC_ENCRYPT or AES_SYNC_DECRYPT

input

Type: const uint8_t *

16-byte input data

output

Type: uint8_t *

16-byte output data

length

Type: uint32_t

Byte length of the input data

iv

Type: uint8_t

Initialization vector (updated after use)

Returns

Type: int32_t

ERR_NONE if successful