Add support for alternative RSA implementations
Alternative RSA implementations can be provided by defining MBEDTLS_RSA_ALT in
config.h, defining an mbedtls_rsa_context struct in a new file rsa_alt.h and
re-implementing the RSA interface specified in rsa.h.
Through the previous reworkings, the adherence to the interface is the only
implementation obligation - in particular, implementors are free to use a
different layout for the RSA context structure.
diff --git a/include/mbedtls/rsa.h b/include/mbedtls/rsa.h
index 8aefdb6..0deff00 100644
--- a/include/mbedtls/rsa.h
+++ b/include/mbedtls/rsa.h
@@ -209,6 +209,8 @@
* Implementation of RSA interface
*/
+#if !defined(MBEDTLS_RSA_ALT)
+
/**
* \brief RSA context structure
*/
@@ -252,6 +254,12 @@
}
mbedtls_rsa_context;
+#else
+
+#include "rsa_alt.h"
+
+#endif /* MBEDTLS_RSA_ALT */
+
/**
* \brief Initialize an RSA context
*