projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Correct AES counter mode, which incorrectly incremented the counter before
[openssl.git]
/
crypto
/
aes
/
aes_ctr.c
diff --git
a/crypto/aes/aes_ctr.c
b/crypto/aes/aes_ctr.c
index 8e800481de00fb26b4de1dcc50da38e070796749..aea3db209272189e4e8fcd6638a3e3ed51048e10 100644
(file)
--- 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;