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/xtea.h b/include/polarssl/xtea.h
index 0db7bc8..c95cb76 100644
--- a/include/polarssl/xtea.h
+++ b/include/polarssl/xtea.h
@@ -3,7 +3,7 @@
*
* \brief XTEA block cipher (32-bit)
*
- * 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,6 +27,8 @@
#ifndef POLARSSL_XTEA_H
#define POLARSSL_XTEA_H
+#include "config.h"
+
#include <string.h>
#ifdef _MSC_VER
@@ -41,6 +43,10 @@
#define POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH -0x0028 /**< The data input has an invalid length. */
+#if !defined(POLARSSL_XTEA_ALT)
+// Regular implementation
+//
+
/**
* \brief XTEA context structure
*/
@@ -97,6 +103,18 @@
unsigned char *input,
unsigned char *output);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* POLARSSL_XTEA_ALT */
+#include "xtea_alt.h"
+#endif /* POLARSSL_XTEA_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* \brief Checkup routine
*