Fix warning with MD/SHA ALT implementation
backport of e217cee
see #239
diff --git a/library/md2.c b/library/md2.c
index 09487e9..548d89e 100644
--- a/library/md2.c
+++ b/library/md2.c
@@ -36,13 +36,13 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_MD2_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;
}
-#if !defined(POLARSSL_MD2_ALT)
-
static const unsigned char PI_SUBST[256] =
{
0x29, 0x2E, 0x43, 0xC9, 0xA2, 0xD8, 0x7C, 0x01, 0x3D, 0x36,
diff --git a/library/md4.c b/library/md4.c
index 6f92f63..1fba4df 100644
--- a/library/md4.c
+++ b/library/md4.c
@@ -36,13 +36,13 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_MD4_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;
}
-#if !defined(POLARSSL_MD4_ALT)
-
/*
* 32-bit integer manipulation macros (little endian)
*/
diff --git a/library/md5.c b/library/md5.c
index 2dbc2bf..2259dc6 100644
--- a/library/md5.c
+++ b/library/md5.c
@@ -35,13 +35,13 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_MD5_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;
}
-#if !defined(POLARSSL_MD5_ALT)
-
/*
* 32-bit integer manipulation macros (little endian)
*/
diff --git a/library/sha1.c b/library/sha1.c
index be463df..4255741 100644
--- a/library/sha1.c
+++ b/library/sha1.c
@@ -35,13 +35,13 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_SHA1_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;
}
-#if !defined(POLARSSL_SHA1_ALT)
-
/*
* 32-bit integer manipulation macros (big endian)
*/
diff --git a/library/sha2.c b/library/sha2.c
index b41bb23..7f9b220 100644
--- a/library/sha2.c
+++ b/library/sha2.c
@@ -35,13 +35,13 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_SHA2_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;
}
-#if !defined(POLARSSL_SHA2_ALT)
-
/*
* 32-bit integer manipulation macros (big endian)
*/
diff --git a/library/sha4.c b/library/sha4.c
index 50987be..ebdc997 100644
--- a/library/sha4.c
+++ b/library/sha4.c
@@ -35,13 +35,13 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_SHA4_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;
}
-#if !defined(POLARSSL_SHA4_ALT)
-
/*
* 64-bit integer manipulation macros (big endian)
*/