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.
diff --git a/include/polarssl/md2.h b/include/polarssl/md2.h
index 1f60470..94f19fc 100644
--- a/include/polarssl/md2.h
+++ b/include/polarssl/md2.h
@@ -3,7 +3,7 @@
*
* \brief MD2 message digest algorithm (hash function)
*
- * 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>
@@ -27,10 +27,16 @@
#ifndef POLARSSL_MD2_H
#define POLARSSL_MD2_H
+#include "config.h"
+
#include <string.h>
#define POLARSSL_ERR_MD2_FILE_IO_ERROR -0x0070 /**< Read/write error in file. */
+#if !defined(POLARSSL_MD2_ALT)
+// Regular implementation
+//
+
/**
* \brief MD2 context structure
*/
@@ -74,6 +80,18 @@
*/
void md2_finish( md2_context *ctx, unsigned char output[16] );
+#ifdef __cplusplus
+}
+#endif
+
+#else /* POLARSSL_MD2_ALT */
+#include "md2_alt.h"
+#endif /* POLARSSL_MD2_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* \brief Output = MD2( input buffer )
*