我试图了解 openSSL 加密库中以下函数的参数。
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);
通过研究这里给出的建议,我能够弄清楚:
*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.
我不确定
ecount_buf
和num
参数。
我看到它num
设置为length % AES_BLOCK_SIZE
通话返回后。
任何指向
ecount_buf
参数用途的指针?