Support alternative implementation for RIPEMD-160
(POLARSSL_RIPEMD160_ALT)
diff --git a/include/polarssl/config.h b/include/polarssl/config.h
index 4861ee1..89fd261 100644
--- a/include/polarssl/config.h
+++ b/include/polarssl/config.h
@@ -148,6 +148,7 @@
//#define POLARSSL_MD2_ALT
//#define POLARSSL_MD4_ALT
//#define POLARSSL_MD5_ALT
+//#define POLARSSL_RIPEMD160_ALT
//#define POLARSSL_SHA1_ALT
//#define POLARSSL_SHA256_ALT
//#define POLARSSL_SHA512_ALT
diff --git a/include/polarssl/ripemd160.h b/include/polarssl/ripemd160.h
index 47a73bd..02a92f5 100644
--- a/include/polarssl/ripemd160.h
+++ b/include/polarssl/ripemd160.h
@@ -40,6 +40,10 @@
#define POLARSSL_ERR_RIPEMD160_FILE_IO_ERROR -0x0074 /**< Read/write error in file. */
+#if !defined(POLARSSL_RIPEMD160_ALT)
+// Regular implementation
+//
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -83,6 +87,21 @@
*/
void ripemd160_finish( ripemd160_context *ctx, unsigned char output[20] );
+/* Internal use */
+void ripemd160_process( ripemd160_context *ctx, const unsigned char data[64] );
+
+#ifdef __cplusplus
+}
+#endif
+
+#else /* POLARSSL_RIPEMD160_ALT */
+#include "ripemd160.h"
+#endif /* POLARSSL_RIPEMD160_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* \brief Output = RIPEMD-160( input buffer )
*
@@ -160,9 +179,6 @@
*/
int ripemd160_self_test( int verbose );
-/* Internal use */
-void ripemd160_process( ripemd160_context *ctx, const unsigned char data[64] );
-
#ifdef __cplusplus
}
#endif