summaryrefslogtreecommitdiffstats
path: root/crypto/aes/aes_ctr.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-05-30 14:06:06 +0000
committerRichard Levitte <levitte@openssl.org>2002-05-30 14:06:06 +0000
commitdbdc5d14d3301ed9dbab16db7e02f3c9518ac3f3 (patch)
tree70e973bbcc5dcacf831a82b96c927d79e45f1f2b /crypto/aes/aes_ctr.c
parent6cbe6382944ff47881593935cc5b029f745beeea (diff)
Correct AES counter mode, which incorrectly incremented the counter before
using it. PR: 56
Diffstat (limited to 'crypto/aes/aes_ctr.c')
-rw-r--r--crypto/aes/aes_ctr.c2
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;