Lines Matching full:d

46  * The public and private key primitives (-)^E and (-)^D are mutually inverse
63 mbedtls_mpi const *E, mbedtls_mpi const *D, in mbedtls_rsa_deduce_primes() argument
92 mbedtls_mpi_cmp_int( D, 1 ) <= 0 || in mbedtls_rsa_deduce_primes()
93 mbedtls_mpi_cmp_mpi( D, N ) >= 0 || in mbedtls_rsa_deduce_primes()
108 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &T, D, E ) ); in mbedtls_rsa_deduce_primes()
174 * be 1 if D,E,N were consistent. in mbedtls_rsa_deduce_primes()
176 * yet eventually failing, computations if N,D,E were not sane. in mbedtls_rsa_deduce_primes()
194 * Given P, Q and the public exponent E, deduce D.
200 mbedtls_mpi *D ) in mbedtls_rsa_deduce_private_exponent() argument
205 if( D == NULL || mbedtls_mpi_cmp_int( D, 0 ) != 0 ) in mbedtls_rsa_deduce_private_exponent()
222 /* Temporarily put D := gcd(P-1, Q-1) */ in mbedtls_rsa_deduce_private_exponent()
223 MBEDTLS_MPI_CHK( mbedtls_mpi_gcd( D, &K, &L ) ); in mbedtls_rsa_deduce_private_exponent()
227 MBEDTLS_MPI_CHK( mbedtls_mpi_div_mpi( &K, NULL, &K, D ) ); in mbedtls_rsa_deduce_private_exponent()
230 MBEDTLS_MPI_CHK( mbedtls_mpi_inv_mod( D, E, &K ) ); in mbedtls_rsa_deduce_private_exponent()
244 const mbedtls_mpi *D, const mbedtls_mpi *DP, in mbedtls_rsa_validate_crt() argument
253 /* Check that DP - D == 0 mod P - 1 */ in mbedtls_rsa_validate_crt()
263 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &L, DP, D ) ); in mbedtls_rsa_validate_crt()
273 /* Check that DQ - D == 0 mod Q - 1 */ in mbedtls_rsa_validate_crt()
283 MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mpi( &L, DQ, D ) ); in mbedtls_rsa_validate_crt()
332 const mbedtls_mpi *Q, const mbedtls_mpi *D, in mbedtls_rsa_validate_params() argument
387 * Step 3: Check and 1 < D, E < N if present. in mbedtls_rsa_validate_params()
390 if( N != NULL && D != NULL && E != NULL ) in mbedtls_rsa_validate_params()
392 if ( mbedtls_mpi_cmp_int( D, 1 ) <= 0 || in mbedtls_rsa_validate_params()
394 mbedtls_mpi_cmp_mpi( D, N ) >= 0 || in mbedtls_rsa_validate_params()
403 * Step 4: Check that D, E are inverse modulo P-1 and Q-1 in mbedtls_rsa_validate_params()
406 if( P != NULL && Q != NULL && D != NULL && E != NULL ) in mbedtls_rsa_validate_params()
416 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &K, D, E ) ); in mbedtls_rsa_validate_params()
427 MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mpi( &K, D, E ) ); in mbedtls_rsa_validate_params()
453 const mbedtls_mpi *D, mbedtls_mpi *DP, in mbedtls_rsa_deduce_crt() argument
460 /* DP = D mod P-1 */ in mbedtls_rsa_deduce_crt()
464 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( DP, D, &K ) ); in mbedtls_rsa_deduce_crt()
467 /* DQ = D mod Q-1 */ in mbedtls_rsa_deduce_crt()
471 MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( DQ, D, &K ) ); in mbedtls_rsa_deduce_crt()