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/library/rsa.c b/library/rsa.c
index dc1fae5..2976b71 100644
--- a/library/rsa.c
+++ b/library/rsa.c
@@ -464,6 +464,7 @@
* Default RSA interface implementation
*/
+#if !defined(MBEDTLS_RSA_ALT)
int mbedtls_rsa_import( mbedtls_rsa_context *ctx,
const mbedtls_mpi *N,
@@ -2493,6 +2494,8 @@
#endif
}
+#endif /* !MBEDTLS_RSA_ALT */
+
#if defined(MBEDTLS_SELF_TEST)
#include "mbedtls/sha1.h"