Provided by: libkcapi-dev_1.1.3-1_amd64

**NAME**

kcapi_cipher_enc_aes_cbc - Convenience function for AES CBC encryption

**SYNOPSIS**

int32_tkcapi_cipher_enc_aes_cbc(constuint8_t*key,uint32_tkeylen,constuint8_t*in,uint32_tinlen,constuint8_t*iv,uint8_t*out,uint32_toutlen);

**ARGUMENTS**

key[in] key bufferkeylen[in] length of key bufferin[in] plaintext data bufferinlen[in] length of in bufferiv[in] IV to be used for cipher operationout[out] ciphertext data bufferoutlen[in] length of out buffer

**DESCRIPTION**

The convenience function performs an AES CBC encryption operation using the provided key, the given input buffer and the given IV. The output is stored in the out buffer. Note, AES CBC requires an input data that is a multiple of 16 bytes. If you have data that is not guaranteed to be multiples of 16 bytes, either add zero bytes at the end of the buffer to pad it up to a multiple of 16 bytes. Otherwise, the CTR mode encryption operation may be usable. The output buffer must be at least as large as the input buffer. The IV must be exactly 16 bytes in size. The AES type (AES-128, AES-192 or AES-256) is determined by the size of the given key. If the key is 16 bytes long, AES-128 is used. A 24 byte key implies AES-192 and a 32 byte key implies AES-256.returnnumber of bytes generated upon success; a negative errno-style error code if an error occurred

**AUTHOR**

StephanMueller<smueller@chronox.de> Author.