Switch to old model for alternative implementations
diff --git a/include/mbedtls/rsa.h b/include/mbedtls/rsa.h
index c0a3a8e..55209b0 100644
--- a/include/mbedtls/rsa.h
+++ b/include/mbedtls/rsa.h
@@ -68,14 +68,15 @@
* The above constants may be used even if the RSA module is compile out,
* eg for alternative (PKCS#11) RSA implemenations in the PK layers.
*/
-#if defined(MBEDTLS_RSA_C)
+
+#if !defined(MBEDTLS_RSA_ALT)
+// Regular implementation
+//
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(MBEDTLS_RSA_ALT)
-
/**
* \brief RSA context structure
*
@@ -125,12 +126,6 @@
}
mbedtls_rsa_context;
-#else
-
-#include "rsa_alt.h"
-
-#endif /* MBEDTLS_RSA_ALT */
-
/**
* \brief Initialize an RSA context
*
@@ -928,6 +923,18 @@
*/
void mbedtls_rsa_free( mbedtls_rsa_context *ctx );
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MBEDTLS_RSA_ALT */
+#include "rsa_alt.h"
+#endif /* MBEDTLS_RSA_ALT */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* \brief Checkup routine
*
@@ -939,6 +946,4 @@
}
#endif
-#endif /* MBEDTLS_RSA_C */
-
#endif /* rsa.h */