Lines Matching refs:prime
736 BIGNUM *exp = &local_exp, *prime = &local_prime; in mod_exp() local
741 BN_with_flags(prime, ap->prime, BN_FLG_CONSTTIME); in mod_exp()
744 if (!BN_mod(r1, c, prime, ctx)) { in mod_exp()
749 !BN_MONT_CTX_set_locked(&ap->mont, &rsa->lock, prime, ctx)) { in mod_exp()
753 if (!rsa->meth->bn_mod_exp(m1, r1, exp, prime, ctx, ap->mont)) { in mod_exp()
761 !BN_mod(m1, m1, prime, ctx) || in mod_exp()
762 (BN_is_negative(m1) && !BN_add(m1, m1, prime)) || in mod_exp()
851 ap->prime = BN_new(); in rsa_default_multi_prime_keygen()
855 if (ap->prime == NULL || in rsa_default_multi_prime_keygen()
953 if (!BN_generate_prime_ex(ap->prime, prime_bits, 0, NULL, NULL, cb)) { in rsa_default_multi_prime_keygen()
956 if (BN_cmp(rsa->p, ap->prime) == 0 || in rsa_default_multi_prime_keygen()
957 BN_cmp(rsa->q, ap->prime) == 0) { in rsa_default_multi_prime_keygen()
962 if (BN_cmp(sk_RSA_additional_prime_value(additional_primes, j)->prime, in rsa_default_multi_prime_keygen()
963 ap->prime) == 0) { in rsa_default_multi_prime_keygen()
971 if (!BN_sub(r2, ap->prime, BN_value_one()) || in rsa_default_multi_prime_keygen()
987 if (!BN_mul(r1, rsa->n, ap->prime, ctx)) { in rsa_default_multi_prime_keygen()
1010 } else if (!BN_mul(rsa->n, rsa->n, ap->prime, ctx)) { in rsa_default_multi_prime_keygen()
1038 if (!BN_sub(r3, ap->prime, BN_value_one()) || in rsa_default_multi_prime_keygen()
1074 if (!BN_sub(ap->exp, ap->prime, BN_value_one()) || in rsa_default_multi_prime_keygen()
1076 !BN_mod_inverse(ap->coeff, ap->r, ap->prime, ctx)) { in rsa_default_multi_prime_keygen()