I am trying to understand the parameters of the following function in openSSL crypto library.
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
unsigned char ivec[AES_BLOCK_SIZE],
unsigned char ecount_buf[AES_BLOCK_SIZE],
unsigned int *num);
By working through the suggestions given here I was able to figure out:
*in - is the buffer in.
*out - is the buffer out.
length - is the the length of the *in buffer.
*key - is the private key.
ivec[0-7] - is the random IV
ivec[8-15] - is the counter thats incremented for every block that's encrypted.
I am not certain about the
ecount_buf
andnum
parameters.
I see that num
is set to length % AES_BLOCK_SIZE
after the call returns.
Any pointers to what the
ecount_buf
parameter is for ?