diff options
author | Paul Bakker <p.j.bakker@polarssl.org> | 2011-03-26 13:40:23 +0000 |
---|---|---|
committer | Paul Bakker <p.j.bakker@polarssl.org> | 2011-03-26 13:40:23 +0000 |
commit | 0216cc1beed7bf225771ae2c6610251c1855bb67 (patch) | |
tree | 4ae85bf2bbeb0cd0f250d6a51b98b585641a6580 | |
parent | 579923c51b35610c86a3e0428bfc64a98db6187f (diff) | |
download | mbedtls-0216cc1beed7bf225771ae2c6610251c1855bb67.zip mbedtls-0216cc1beed7bf225771ae2c6610251c1855bb67.tar.gz mbedtls-0216cc1beed7bf225771ae2c6610251c1855bb67.tar.bz2 |
- Added flag to disable Chinese Remainder Theorem when using RSA private operation (POLARSSL_RSA_NO_CRT)
-rw-r--r-- | include/polarssl/config.h | 10 | ||||
-rw-r--r-- | library/rsa.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/include/polarssl/config.h b/include/polarssl/config.h index f248bdc..09807fa 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -143,6 +143,16 @@ * #define POLARSSL_AES_ROM_TABLES */ + +/** + * \def POLARSSL_RSA_NO_CRT + * + * Do not use the Chinese Remainder Theorem for the RSA private operation. + * + * Uncomment this macro to disable the use of CRT in RSA. + * +#define POLARSSL_RSA_NO_CRT + */ /* \} name */ /** diff --git a/library/rsa.c b/library/rsa.c index 0a6c490..a0f750e 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -253,7 +253,7 @@ int rsa_private( rsa_context *ctx, return( POLARSSL_ERR_RSA_BAD_INPUT_DATA ); } -#if 0 +#if defined(POLARSSL_RSA_NO_CRT) MPI_CHK( mpi_exp_mod( &T, &T, &ctx->D, &ctx->N, &ctx->RN ) ); #else /* |