diff options
author | Richard Levitte <levitte@openssl.org> | 2002-05-30 14:06:17 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-05-30 14:06:17 +0000 |
commit | 6c98ed520dfbf3e20f2d5be9525da285b810881b (patch) | |
tree | 50562fb29936117ab38d0c119565a19b1610baad /crypto/aes | |
parent | 37ceea73331c9c677afa2bc340e9c294231f8ef8 (diff) |
Correct AES counter mode, which incorrectly incremented the counter before
using it.
PR: 56
Diffstat (limited to 'crypto/aes')
-rw-r--r-- | crypto/aes/aes_ctr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/aes/aes_ctr.c b/crypto/aes/aes_ctr.c index 8e800481de..aea3db2092 100644 --- a/crypto/aes/aes_ctr.c +++ b/crypto/aes/aes_ctr.c @@ -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; |