tc_ctr_mode() function
CTR mode encryption/decryption procedure. CTR mode encrypts (or decrypts) inlen bytes from in buffer into out buffer
Arguments
out
OUT -- produced ciphertext (plaintext)
outlen
IN -- length of ciphertext buffer in bytes
in
IN -- data to encrypt (or decrypt)
inlen
IN -- length of input data in bytes
ctr
IN/OUT -- the current counter value
sched
IN -- an initialized AES key schedule
Return value
returns TC_CRYPTO_SUCCESS (1) returns TC_CRYPTO_FAIL (0) if: out == NULL or in == NULL or ctr == NULL or sched == NULL or inlen == 0 or outlen == 0 or inlen != outlen
Notes
Assumes:- The current value in ctr has NOT been used with sched - out points to inlen bytes - in points to inlen bytes - ctr is an integer counter in littleEndian format - sched was initialized by aes_set_encrypt_key
![]()
int tc_ctr_mode(uint8_t *out, unsigned int outlen, const uint8_t *in,![]()
int tc_ctr_mode(uint8_t *out, unsigned int outlen, const uint8_t *in,![]()
int tc_ctr_mode(uint8_t *out, unsigned int outlen, const uint8_t *in,![]()
int tc_ctr_mode(uint8_t *out, unsigned int outlen, const uint8_t *in,
tc_ctr_mode() calls 2 functions:
![]()
tc_ctr_mode()
tc_ctr_mode():
![]()
tc_ctr_mode()