diff --git a/include/mbedtls/rsa_internal.h b/include/mbedtls/rsa_internal.h index 080f09f7a..3b351c916 100644 --- a/include/mbedtls/rsa_internal.h +++ b/include/mbedtls/rsa_internal.h @@ -72,8 +72,8 @@ extern "C" { * overwrite it. * * \param N RSA modulus N = PQ, with P, Q to be found - * \param D RSA private 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 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. * */ -int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *D, - mbedtls_mpi const *E, +int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E, + mbedtls_mpi const *D, mbedtls_mpi *P, mbedtls_mpi *Q ); /** diff --git a/library/rsa.c b/library/rsa.c index 5366abc22..bf24a09b1 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -274,7 +274,7 @@ int mbedtls_rsa_complete( mbedtls_rsa_context *ctx ) 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 ); if( ret != 0 ) return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA + ret ); diff --git a/library/rsa_internal.c b/library/rsa_internal.c index 3b54fdee7..f65f0dfcf 100644 --- a/library/rsa_internal.c +++ b/library/rsa_internal.c @@ -66,7 +66,7 @@ * */ 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 ) { int ret = 0;