Lines Matching refs:P
64 mbedtls_mpi *P, mbedtls_mpi *Q) in mbedtls_rsa_deduce_primes() argument
87 if (P == NULL || Q == NULL || P->p != NULL || Q->p != NULL) { in mbedtls_rsa_deduce_primes()
132 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(P, &K, N)); in mbedtls_rsa_deduce_primes()
133 if (mbedtls_mpi_cmp_int(P, 1) != 0) { in mbedtls_rsa_deduce_primes()
151 MBEDTLS_MPI_CHK(mbedtls_mpi_gcd(P, &K, N)); in mbedtls_rsa_deduce_primes()
153 if (mbedtls_mpi_cmp_int(P, 1) == 1 && in mbedtls_rsa_deduce_primes()
154 mbedtls_mpi_cmp_mpi(P, N) == -1) { in mbedtls_rsa_deduce_primes()
160 MBEDTLS_MPI_CHK(mbedtls_mpi_div_mpi(Q, NULL, N, P)); in mbedtls_rsa_deduce_primes()
194 int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P, in mbedtls_rsa_deduce_private_exponent() argument
206 if (mbedtls_mpi_cmp_int(P, 1) <= 0 || in mbedtls_rsa_deduce_private_exponent()
216 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&K, P, 1)); in mbedtls_rsa_deduce_private_exponent()
237 int mbedtls_rsa_deduce_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_deduce_crt() argument
247 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&K, P, 1)); in mbedtls_rsa_deduce_crt()
259 MBEDTLS_MPI_CHK(mbedtls_mpi_inv_mod(QP, Q, P)); in mbedtls_rsa_deduce_crt()
271 int mbedtls_rsa_validate_params(const mbedtls_mpi *N, const mbedtls_mpi *P, in mbedtls_rsa_validate_params() argument
293 if (f_rng != NULL && P != NULL && in mbedtls_rsa_validate_params()
294 (ret = mbedtls_mpi_is_prime_ext(P, 50, f_rng, p_rng)) != 0) { in mbedtls_rsa_validate_params()
313 if (P != NULL && Q != NULL && N != NULL) { in mbedtls_rsa_validate_params()
314 MBEDTLS_MPI_CHK(mbedtls_mpi_mul_mpi(&K, P, Q)); in mbedtls_rsa_validate_params()
340 if (P != NULL && Q != NULL && D != NULL && E != NULL) { in mbedtls_rsa_validate_params()
341 if (mbedtls_mpi_cmp_int(P, 1) <= 0 || in mbedtls_rsa_validate_params()
350 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&L, P, 1)); in mbedtls_rsa_validate_params()
384 int mbedtls_rsa_validate_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q, in mbedtls_rsa_validate_crt() argument
396 if (P == NULL) { in mbedtls_rsa_validate_crt()
401 MBEDTLS_MPI_CHK(mbedtls_mpi_sub_int(&K, P, 1)); in mbedtls_rsa_validate_crt()
430 if (P == NULL || Q == NULL) { in mbedtls_rsa_validate_crt()
437 MBEDTLS_MPI_CHK(mbedtls_mpi_mod_mpi(&K, &K, P)); in mbedtls_rsa_validate_crt()