summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/aes/aes_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/aes/aes_core.c')
-rw-r--r--src/lib/libcrypto/aes/aes_core.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/libcrypto/aes/aes_core.c b/src/lib/libcrypto/aes/aes_core.c
index 937988dd8c..2f41a825f8 100644
--- a/src/lib/libcrypto/aes/aes_core.c
+++ b/src/lib/libcrypto/aes/aes_core.c
@@ -28,7 +28,13 @@
28/* Note: rewritten a little bit to provide error control and an OpenSSL- 28/* Note: rewritten a little bit to provide error control and an OpenSSL-
29 compatible API */ 29 compatible API */
30 30
31#ifndef AES_DEBUG
32# ifndef NDEBUG
33# define NDEBUG
34# endif
35#endif
31#include <assert.h> 36#include <assert.h>
37
32#include <stdlib.h> 38#include <stdlib.h>
33#include <openssl/aes.h> 39#include <openssl/aes.h>
34#include "aes_locl.h" 40#include "aes_locl.h"
@@ -744,7 +750,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
744 rk[2] = GETU32(userKey + 8); 750 rk[2] = GETU32(userKey + 8);
745 rk[3] = GETU32(userKey + 12); 751 rk[3] = GETU32(userKey + 12);
746 if (bits == 128) { 752 if (bits == 128) {
747 for (;;) { 753 while (1) {
748 temp = rk[3]; 754 temp = rk[3];
749 rk[4] = rk[0] ^ 755 rk[4] = rk[0] ^
750 (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ 756 (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
@@ -764,7 +770,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
764 rk[4] = GETU32(userKey + 16); 770 rk[4] = GETU32(userKey + 16);
765 rk[5] = GETU32(userKey + 20); 771 rk[5] = GETU32(userKey + 20);
766 if (bits == 192) { 772 if (bits == 192) {
767 for (;;) { 773 while (1) {
768 temp = rk[ 5]; 774 temp = rk[ 5];
769 rk[ 6] = rk[ 0] ^ 775 rk[ 6] = rk[ 0] ^
770 (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ 776 (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
@@ -786,7 +792,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
786 rk[6] = GETU32(userKey + 24); 792 rk[6] = GETU32(userKey + 24);
787 rk[7] = GETU32(userKey + 28); 793 rk[7] = GETU32(userKey + 28);
788 if (bits == 256) { 794 if (bits == 256) {
789 for (;;) { 795 while (1) {
790 temp = rk[ 7]; 796 temp = rk[ 7];
791 rk[ 8] = rk[ 0] ^ 797 rk[ 8] = rk[ 0] ^
792 (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ 798 (Te4[(temp >> 16) & 0xff] & 0xff000000) ^