Swap D,E parameters in mbedtls_rsa_deduce_primes

This commit is contained in:
Hanno Becker 2017-10-17 09:15:06 +01:00
parent 854244abbf
commit c36aab69b5
3 changed files with 5 additions and 5 deletions

View File

@ -72,8 +72,8 @@ extern "C" {
* overwrite it. * overwrite it.
* *
* \param N RSA modulus N = PQ, with P, Q to be found * \param N RSA modulus N = PQ, with P, Q to be found
* \param D RSA private exponent
* \param E RSA public exponent * \param E RSA public exponent
* \param D RSA private exponent
* \param P Pointer to MPI holding first prime factor of N on success * \param P Pointer to MPI holding first prime factor of N on success
* \param Q Pointer to MPI holding second prime factor of N on success * \param Q Pointer to MPI holding second prime factor of N on success
* *
@ -87,8 +87,8 @@ extern "C" {
* use the helper function \c mbedtls_rsa_validate_params. * use the helper function \c mbedtls_rsa_validate_params.
* *
*/ */
int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *D, int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E,
mbedtls_mpi const *E, mbedtls_mpi const *D,
mbedtls_mpi *P, mbedtls_mpi *Q ); mbedtls_mpi *P, mbedtls_mpi *Q );
/** /**

View File

@ -274,7 +274,7 @@ int mbedtls_rsa_complete( mbedtls_rsa_context *ctx )
if( pq_missing ) if( pq_missing )
{ {
ret = mbedtls_rsa_deduce_primes( &ctx->N, &ctx->D, &ctx->E, ret = mbedtls_rsa_deduce_primes( &ctx->N, &ctx->E, &ctx->D,
&ctx->P, &ctx->Q ); &ctx->P, &ctx->Q );
if( ret != 0 ) if( ret != 0 )
return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA + ret ); return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA + ret );

View File

@ -66,7 +66,7 @@
* *
*/ */
int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N,
mbedtls_mpi const *D, mbedtls_mpi const *E, mbedtls_mpi const *E, mbedtls_mpi const *D,
mbedtls_mpi *P, mbedtls_mpi *Q ) mbedtls_mpi *P, mbedtls_mpi *Q )
{ {
int ret = 0; int ret = 0;