wangyu- 8 лет назад
Родитель
Сommit
3cdac6d95c
2 измененных файлов с 19 добавлено и 5 удалено
  1. 8 4
      lib/aes_c/aes.c
  2. 11 1
      lib/aes_c/aes.h

+ 8 - 4
lib/aes_c/aes.c

@@ -29,15 +29,18 @@
  *  http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
  */
 
+/*
 #if !defined(POLARSSL_CONFIG_FILE)
 #include "polarssl/config.h"
 #else
 #include POLARSSL_CONFIG_FILE
 #endif
+*/
+//#if defined(POLARSSL_AES_C)
 
-#if defined(POLARSSL_AES_C)
 
-#include "polarssl/aes.h"
+#include "aes.h"
+/*
 #if defined(POLARSSL_PADLOCK_C)
 #include "polarssl/padlock.h"
 #endif
@@ -50,12 +53,13 @@
 #else
 #define polarssl_printf printf
 #endif
+*/
 
 #if !defined(POLARSSL_AES_ALT)
 
 /* Implementation that should never be optimized out by the compiler */
 static void polarssl_zeroize( void *v, size_t n ) {
-    volatile unsigned char *p = v; while( n-- ) *p++ = 0;
+    volatile unsigned char *p = (unsigned char *)v; while( n-- ) *p++ = 0;
 }
 
 /*
@@ -1451,4 +1455,4 @@ exit:
 
 #endif /* POLARSSL_SELF_TEST */
 
-#endif /* POLARSSL_AES_C */
+//#endif /* POLARSSL_AES_C */

+ 11 - 1
lib/aes_c/aes.h

@@ -26,12 +26,22 @@
  */
 #ifndef POLARSSL_AES_H
 #define POLARSSL_AES_H
-
+/*
 #if !defined(POLARSSL_CONFIG_FILE)
 #include "config.h"
 #else
 #include POLARSSL_CONFIG_FILE
 #endif
+*/
+
+////////modification begin
+#define POLARSSL_AES_ROM_TABLES
+#define POLARSSL_CIPHER_MODE_CBC
+#define POLARSSL_SELF_TEST
+#define polarssl_printf printf
+///////add end
+
+
 
 #include <string.h>