Added mechanism to provide alternative cipher / hash implementations
All symmetric cipher algorithms and hash algorithms now include support
for a POLARSSL_XXX_ALT flag that prevents the definition of the
algorithm context structure and all 'core' functions.
(cherry picked from commit 4087c47043cb7b8b51e69f1de47ab6a2bccead3d)
diff --git a/library/sha1.c b/library/sha1.c
index 372c0c1..b301b09 100644
--- a/library/sha1.c
+++ b/library/sha1.c
@@ -1,7 +1,7 @@
/*
* FIPS-180-1 compliant SHA-1 implementation
*
- * Copyright (C) 2006-2010, Brainspark B.V.
+ * Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@@ -38,6 +38,8 @@
#include <stdio.h>
#endif
+#if !defined(POLARSSL_SHA1_ALT)
+
/*
* 32-bit integer manipulation macros (big endian)
*/
@@ -309,6 +311,8 @@
PUT_UINT32_BE( ctx->state[4], output, 16 );
}
+#endif /* !POLARSSL_SHA1_ALT */
+
/*
* output = SHA-1( input buffer )
*/