summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/aes
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/aes')
-rw-r--r--src/lib/libcrypto/aes/aes_cfb.c2
-rw-r--r--src/lib/libcrypto/aes/aes_ctr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/aes/aes_cfb.c b/src/lib/libcrypto/aes/aes_cfb.c
index 9b2917298a..41c2a5ec3d 100644
--- a/src/lib/libcrypto/aes/aes_cfb.c
+++ b/src/lib/libcrypto/aes/aes_cfb.c
@@ -137,7 +137,7 @@ void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
137 } else { 137 } else {
138 while (l--) { 138 while (l--) {
139 if (n == 0) { 139 if (n == 0) {
140 AES_decrypt(ivec, ivec, key); 140 AES_encrypt(ivec, ivec, key);
141 } 141 }
142 c = *(in); 142 c = *(in);
143 *(out++) = *(in++) ^ ivec[n]; 143 *(out++) = *(in++) ^ ivec[n];
diff --git a/src/lib/libcrypto/aes/aes_ctr.c b/src/lib/libcrypto/aes/aes_ctr.c
index 8e800481de..aea3db2092 100644
--- a/src/lib/libcrypto/aes/aes_ctr.c
+++ b/src/lib/libcrypto/aes/aes_ctr.c
@@ -106,8 +106,8 @@ void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
106 106
107 while (l--) { 107 while (l--) {
108 if (n == 0) { 108 if (n == 0) {
109 AES_ctr128_inc(counter);
110 AES_encrypt(counter, tmp, key); 109 AES_encrypt(counter, tmp, key);
110 AES_ctr128_inc(counter);
111 } 111 }
112 *(out++) = *(in++) ^ tmp[n]; 112 *(out++) = *(in++) ^ tmp[n];
113 n = (n+1) % AES_BLOCK_SIZE; 113 n = (n+1) % AES_BLOCK_SIZE;