提交 dbdc5d14 编写于 作者: R Richard Levitte

Correct AES counter mode, which incorrectly incremented the counter before

using it.
PR: 56
上级 6cbe6382
......@@ -106,8 +106,8 @@ void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
while (l--) {
if (n == 0) {
AES_ctr128_inc(counter);
AES_encrypt(counter, tmp, key);
AES_ctr128_inc(counter);
}
*(out++) = *(in++) ^ tmp[n];
n = (n+1) % AES_BLOCK_SIZE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册