summaryrefslogtreecommitdiffstats
path: root/crypto/rsa
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-02-19 19:15:41 +1000
committerShane Lontis <shane.lontis@oracle.com>2021-02-26 10:32:22 +1000
commit94553e85b68af4513a8ee89cd2a0d4e044d75139 (patch)
tree2150abcbe848f0d1973b0186bd6864595e3f18a2 /crypto/rsa
parent2d968951227acd422f0e712035de3216d47fc980 (diff)
Fix external symbols for bn
Partial fix for #12964 This adds ossl_ names for symbols related to bn_* Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14296)
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_sp800_56b_check.c11
-rw-r--r--crypto/rsa/rsa_sp800_56b_gen.c8
2 files changed, 10 insertions, 9 deletions
diff --git a/crypto/rsa/rsa_sp800_56b_check.c b/crypto/rsa/rsa_sp800_56b_check.c
index 173bc5e253..c2066236f9 100644
--- a/crypto/rsa/rsa_sp800_56b_check.c
+++ b/crypto/rsa/rsa_sp800_56b_check.c
@@ -92,7 +92,7 @@ int ossl_rsa_check_prime_factor_range(const BIGNUM *p, int nbits, BN_CTX *ctx)
int shift;
nbits >>= 1;
- shift = nbits - BN_num_bits(&bn_inv_sqrt_2);
+ shift = nbits - BN_num_bits(&ossl_bn_inv_sqrt_2);
/* Upper bound check */
if (BN_num_bits(p) != nbits)
@@ -104,12 +104,12 @@ int ossl_rsa_check_prime_factor_range(const BIGNUM *p, int nbits, BN_CTX *ctx)
goto err;
/* set low = (√2)(2^(nbits/2 - 1) */
- if (!BN_copy(low, &bn_inv_sqrt_2))
+ if (!BN_copy(low, &ossl_bn_inv_sqrt_2))
goto err;
if (shift >= 0) {
/*
- * We don't have all the bits. bn_inv_sqrt_2 contains a rounded up
+ * We don't have all the bits. ossl_bn_inv_sqrt_2 contains a rounded up
* value, so there is a very low probability that we'll reject a valid
* value.
*/
@@ -329,12 +329,13 @@ int ossl_rsa_sp800_56b_check_public(const RSA *rsa)
* The modulus is composite, but not a power of a prime.
* The modulus has no factors smaller than 752.
*/
- if (!BN_gcd(gcd, rsa->n, bn_get0_small_factors(), ctx) || !BN_is_one(gcd)) {
+ if (!BN_gcd(gcd, rsa->n, ossl_bn_get0_small_factors(), ctx)
+ || !BN_is_one(gcd)) {
ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_MODULUS);
goto err;
}
- ret = bn_miller_rabin_is_prime(rsa->n, 0, ctx, NULL, 1, &status);
+ ret = ossl_bn_miller_rabin_is_prime(rsa->n, 0, ctx, NULL, 1, &status);
if (ret != 1 || status != BN_PRIMETEST_COMPOSITE_NOT_POWER_OF_PRIME) {
ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_MODULUS);
ret = 0;
diff --git a/crypto/rsa/rsa_sp800_56b_gen.c b/crypto/rsa/rsa_sp800_56b_gen.c
index 3fffb3b80a..87fd4ad50c 100644
--- a/crypto/rsa/rsa_sp800_56b_gen.c
+++ b/crypto/rsa/rsa_sp800_56b_gen.c
@@ -121,13 +121,13 @@ int ossl_rsa_fips186_4_gen_prob_primes(RSA *rsa, RSA_ACVP_TEST *test,
BN_set_flags(rsa->q, BN_FLG_CONSTTIME);
/* (Step 4) Generate p, Xp */
- if (!bn_rsa_fips186_4_gen_prob_primes(rsa->p, Xpo, p1, p2, Xp, Xp1, Xp2,
- nbits, e, ctx, cb))
+ if (!ossl_bn_rsa_fips186_4_gen_prob_primes(rsa->p, Xpo, p1, p2, Xp, Xp1, Xp2,
+ nbits, e, ctx, cb))
goto err;
for(;;) {
/* (Step 5) Generate q, Xq*/
- if (!bn_rsa_fips186_4_gen_prob_primes(rsa->q, Xqo, q1, q2, Xq, Xq1,
- Xq2, nbits, e, ctx, cb))
+ if (!ossl_bn_rsa_fips186_4_gen_prob_primes(rsa->q, Xqo, q1, q2, Xq, Xq1,
+ Xq2, nbits, e, ctx, cb))
goto err;
/* (Step 6) |Xp - Xq| > 2^(nbitlen/2 - 100) */