Lines Matching +full:- +full:p
4 * \brief Context-independent RSA helper functions
6 * This module declares some RSA-related helper functions useful when
13 * End-users of Mbed TLS who are not providing their own alternative RSA
23 * (1) Parameter-generating helpers. These are:
24 * - mbedtls_rsa_deduce_primes
25 * - mbedtls_rsa_deduce_private_exponent
26 * - mbedtls_rsa_deduce_crt
30 * (2) Parameter-checking helpers. These are:
31 * - mbedtls_rsa_validate_params
32 * - mbedtls_rsa_validate_crt
39 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
54 * \brief Compute RSA prime moduli P, Q from public modulus N=PQ
61 * \param N RSA modulus N = PQ, with P, Q to be found
64 * \param P Pointer to MPI holding first prime factor of N on success
68 * - 0 if successful. In this case, P and Q constitute a
70 * - A non-zero error code otherwise.
72 * \note It is neither checked that P, Q are prime nor that
73 * D, E are modular inverses wrt. P-1 and Q-1. For that,
79 mbedtls_mpi *P, mbedtls_mpi *Q);
89 * \param P First prime factor of RSA modulus
95 * - 0 if successful. In this case, D is set to a simultaneous
96 * modular inverse of E modulo both P-1 and Q-1.
97 * - A non-zero error code otherwise.
99 * \note This function does not check whether P and Q are primes.
102 int mbedtls_rsa_deduce_private_exponent(mbedtls_mpi const *P,
109 * \brief Generate RSA-CRT parameters
115 * \param P First prime factor of N
118 * \param DP Output variable for D modulo P-1
119 * \param DQ Output variable for D modulo Q-1
120 * \param QP Output variable for the modular inverse of Q modulo P.
122 * \return 0 on success, non-zero error code otherwise.
124 * \note This function does not check whether P, Q are
128 int mbedtls_rsa_deduce_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q,
141 * \param P First prime factor of N
149 * - 0 if the following conditions are satisfied
151 * - P prime if f_rng != NULL (%)
152 * - Q prime if f_rng != NULL (%)
153 * - 1 < N = P * Q
154 * - 1 < D, E < N
155 * - D and E are modular inverses modulo P-1 and Q-1
157 * - A non-zero error code otherwise.
161 * (-,P,-,-,-) and a PRNG amounts to a primality check for P.
163 int mbedtls_rsa_validate_params(const mbedtls_mpi *N, const mbedtls_mpi *P,
176 * \param P First prime factor of RSA modulus
179 * \param DP MPI to check for D modulo P-1
180 * \param DQ MPI to check for D modulo P-1
181 * \param QP MPI to check for the modular inverse of Q modulo P.
184 * - 0 if the following conditions are satisfied:
185 * - D = DP mod P-1 if P, D, DP != NULL
186 * - Q = DQ mod P-1 if P, D, DQ != NULL
187 * - QP = Q^-1 mod P if P, Q, QP != NULL
188 * - \c MBEDTLS_ERR_RSA_KEY_CHECK_FAILED if check failed,
191 * - \c MBEDTLS_ERR_RSA_BAD_INPUT_DATA if insufficient
196 * parameters (P, -, D, DP, -, -) will check DP = D mod P-1.
198 int mbedtls_rsa_validate_crt(const mbedtls_mpi *P, const mbedtls_mpi *Q,