Switch to old model for alternative implementations

This commit is contained in:
Hanno Becker 2017-10-12 11:42:17 +01:00
parent ebd2c024dc
commit d22b78bf12
2 changed files with 16 additions and 16 deletions

View File

@ -68,14 +68,15 @@
* The above constants may be used even if the RSA module is compile out, * 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. * 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 #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if !defined(MBEDTLS_RSA_ALT)
/** /**
* \brief RSA context structure * \brief RSA context structure
* *
@ -125,12 +126,6 @@ typedef struct
} }
mbedtls_rsa_context; mbedtls_rsa_context;
#else
#include "rsa_alt.h"
#endif /* MBEDTLS_RSA_ALT */
/** /**
* \brief Initialize an RSA context * \brief Initialize an RSA context
* *
@ -928,6 +923,18 @@ int mbedtls_rsa_copy( mbedtls_rsa_context *dst, const mbedtls_rsa_context *src )
*/ */
void mbedtls_rsa_free( mbedtls_rsa_context *ctx ); 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 * \brief Checkup routine
* *
@ -939,6 +946,4 @@ int mbedtls_rsa_self_test( int verbose );
} }
#endif #endif
#endif /* MBEDTLS_RSA_C */
#endif /* rsa.h */ #endif /* rsa.h */

View File

@ -58,8 +58,6 @@
#include "bignum.h" #include "bignum.h"
#if defined(MBEDTLS_RSA_C)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -213,7 +211,4 @@ int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
const mbedtls_mpi *D, const mbedtls_mpi *DP, const mbedtls_mpi *D, const mbedtls_mpi *DP,
const mbedtls_mpi *DQ, const mbedtls_mpi *QP ); const mbedtls_mpi *DQ, const mbedtls_mpi *QP );
#endif /* MBEDTLS_RSA_C */
#endif /* rsa_internal.h */ #endif /* rsa_internal.h */