tc_cbc_mode_decrypt() function
CBC decryption procedure CBC decrypts inlen bytes of the in buffer into the out buffer using the provided encryption key schedule
Arguments
out
IN/OUT -- buffer to receive decrypted data
outlen
IN -- length of plaintext buffer in bytes
in
IN -- ciphertext to decrypt, including IV
inlen
IN -- length of ciphertext buffer in bytes
iv
IN -- the IV for the this encrypt/decrypt
sched
IN -- AES key schedule for this decrypt
Return value
returns TC_CRYPTO_SUCCESS (1) returns TC_CRYPTO_FAIL (0) if: out == NULL or in == NULL or sched == NULL or inlen == 0 or outlen == 0 or (inlen % TC_AES_BLOCK_SIZE) != 0 or (outlen % TC_AES_BLOCK_SIZE) != 0 or outlen != inlen + TC_AES_BLOCK_SIZE
Notes
Assumes:- in == iv + ciphertext, i.e. the iv and the ciphertext are contiguous. This allows for a very efficient decryption algorithm that would not otherwise be possible - sched was configured by aes_set_decrypt_key - out buffer is large enough to hold the decrypted plaintext and is a contiguous buffer - inlen gives the number of bytes in the in buffer
![]()
int tc_cbc_mode_decrypt(uint8_t *out, unsigned int outlen, const uint8_t *in,![]()
int tc_cbc_mode_decrypt(uint8_t *out, unsigned int outlen, const uint8_t *in,![]()
int tc_cbc_mode_decrypt(uint8_t *out, unsigned int outlen, const uint8_t *in,![]()
int tc_cbc_mode_decrypt(uint8_t *out, unsigned int outlen, const uint8_t *in,
tc_cbc_mode_decrypt() calls 1 function:
![]()
tc_cbc_mode_decrypt()
tc_cbc_mode_decrypt():
![]()
tc_cbc_mode_decrypt()