Allow alternate implementation of GCM
Provide the ability to use an alternative implementation of GCM in place
of the library-provided implementation.
diff --git a/include/mbedtls/gcm.h b/include/mbedtls/gcm.h
index 1b77aae..8f3b565 100644
--- a/include/mbedtls/gcm.h
+++ b/include/mbedtls/gcm.h
@@ -33,6 +33,8 @@
#define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */
#define MBEDTLS_ERR_GCM_BAD_INPUT -0x0014 /**< Bad input parameters to function. */
+#if !defined(MBEDTLS_GCM_ALT)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -206,6 +208,18 @@
*/
void mbedtls_gcm_free( mbedtls_gcm_context *ctx );
+#ifdef __cplusplus
+}
+#endif
+
+#else /* !MBEDTLS_GCM_ALT */
+#include "gcm_alt.h"
+#endif /* !MBEDTLS_GCM_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* \brief Checkup routine
*
@@ -217,4 +231,5 @@
}
#endif
+
#endif /* gcm.h */