summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-04-26 13:35:51 -0400
committerPauli <pauli@openssl.org>2021-04-28 10:16:32 +1000
commitc0a79e9836a9aa30912978f69fab3b3bb3a8ddc5 (patch)
tree572977188d368ecdd7fbba23fab851feb218d1a7 /crypto/bn
parente6760e3e84caa341e6b93d87d98edcbccd2d3003 (diff)
Rename some globals, add ossl prefix.
Fixes: 13562 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15035)
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_nist.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c
index 17881233a4..ad3cc6b85c 100644
--- a/crypto/bn/bn_nist.c
+++ b/crypto/bn/bn_nist.c
@@ -184,7 +184,7 @@ static const BN_ULONG _nist_p_521_sqr[] = {
# error "unsupported BN_BITS2"
#endif
-static const BIGNUM _bignum_nist_p_192 = {
+static const BIGNUM ossl_bignum_nist_p_192 = {
(BN_ULONG *)_nist_p_192[0],
BN_NIST_192_TOP,
BN_NIST_192_TOP,
@@ -192,7 +192,7 @@ static const BIGNUM _bignum_nist_p_192 = {
BN_FLG_STATIC_DATA
};
-static const BIGNUM _bignum_nist_p_224 = {
+static const BIGNUM ossl_bignum_nist_p_224 = {
(BN_ULONG *)_nist_p_224[0],
BN_NIST_224_TOP,
BN_NIST_224_TOP,
@@ -200,7 +200,7 @@ static const BIGNUM _bignum_nist_p_224 = {
BN_FLG_STATIC_DATA
};
-static const BIGNUM _bignum_nist_p_256 = {
+static const BIGNUM ossl_bignum_nist_p_256 = {
(BN_ULONG *)_nist_p_256[0],
BN_NIST_256_TOP,
BN_NIST_256_TOP,
@@ -208,7 +208,7 @@ static const BIGNUM _bignum_nist_p_256 = {
BN_FLG_STATIC_DATA
};
-static const BIGNUM _bignum_nist_p_384 = {
+static const BIGNUM ossl_bignum_nist_p_384 = {
(BN_ULONG *)_nist_p_384[0],
BN_NIST_384_TOP,
BN_NIST_384_TOP,
@@ -216,7 +216,7 @@ static const BIGNUM _bignum_nist_p_384 = {
BN_FLG_STATIC_DATA
};
-static const BIGNUM _bignum_nist_p_521 = {
+static const BIGNUM ossl_bignum_nist_p_521 = {
(BN_ULONG *)_nist_p_521,
BN_NIST_521_TOP,
BN_NIST_521_TOP,
@@ -226,27 +226,27 @@ static const BIGNUM _bignum_nist_p_521 = {
const BIGNUM *BN_get0_nist_prime_192(void)
{
- return &_bignum_nist_p_192;
+ return &ossl_bignum_nist_p_192;
}
const BIGNUM *BN_get0_nist_prime_224(void)
{
- return &_bignum_nist_p_224;
+ return &ossl_bignum_nist_p_224;
}
const BIGNUM *BN_get0_nist_prime_256(void)
{
- return &_bignum_nist_p_256;
+ return &ossl_bignum_nist_p_256;
}
const BIGNUM *BN_get0_nist_prime_384(void)
{
- return &_bignum_nist_p_384;
+ return &ossl_bignum_nist_p_384;
}
const BIGNUM *BN_get0_nist_prime_521(void)
{
- return &_bignum_nist_p_521;
+ return &ossl_bignum_nist_p_521;
}
static void nist_cp_bn_0(BN_ULONG *dst, const BN_ULONG *src, int top, int max)
@@ -328,16 +328,16 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
} buf;
BN_ULONG c_d[BN_NIST_192_TOP], *res;
PTR_SIZE_INT mask;
- static const BIGNUM _bignum_nist_p_192_sqr = {
+ static const BIGNUM ossl_bignum_nist_p_192_sqr = {
(BN_ULONG *)_nist_p_192_sqr,
OSSL_NELEM(_nist_p_192_sqr),
OSSL_NELEM(_nist_p_192_sqr),
0, BN_FLG_STATIC_DATA
};
- field = &_bignum_nist_p_192; /* just to make sure */
+ field = &ossl_bignum_nist_p_192; /* just to make sure */
- if (BN_is_negative(a) || BN_ucmp(a, &_bignum_nist_p_192_sqr) >= 0)
+ if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_192_sqr) >= 0)
return BN_nnmod(r, a, field, ctx);
i = BN_ucmp(field, a);
@@ -473,16 +473,16 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
bn_addsub_f f;
PTR_SIZE_INT p;
} u;
- static const BIGNUM _bignum_nist_p_224_sqr = {
+ static const BIGNUM ossl_bignum_nist_p_224_sqr = {
(BN_ULONG *)_nist_p_224_sqr,
OSSL_NELEM(_nist_p_224_sqr),
OSSL_NELEM(_nist_p_224_sqr),
0, BN_FLG_STATIC_DATA
};
- field = &_bignum_nist_p_224; /* just to make sure */
+ field = &ossl_bignum_nist_p_224; /* just to make sure */
- if (BN_is_negative(a) || BN_ucmp(a, &_bignum_nist_p_224_sqr) >= 0)
+ if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_224_sqr) >= 0)
return BN_nnmod(r, a, field, ctx);
i = BN_ucmp(field, a);
@@ -654,16 +654,16 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
bn_addsub_f f;
PTR_SIZE_INT p;
} u;
- static const BIGNUM _bignum_nist_p_256_sqr = {
+ static const BIGNUM ossl_bignum_nist_p_256_sqr = {
(BN_ULONG *)_nist_p_256_sqr,
OSSL_NELEM(_nist_p_256_sqr),
OSSL_NELEM(_nist_p_256_sqr),
0, BN_FLG_STATIC_DATA
};
- field = &_bignum_nist_p_256; /* just to make sure */
+ field = &ossl_bignum_nist_p_256; /* just to make sure */
- if (BN_is_negative(a) || BN_ucmp(a, &_bignum_nist_p_256_sqr) >= 0)
+ if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_256_sqr) >= 0)
return BN_nnmod(r, a, field, ctx);
i = BN_ucmp(field, a);
@@ -900,16 +900,16 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
bn_addsub_f f;
PTR_SIZE_INT p;
} u;
- static const BIGNUM _bignum_nist_p_384_sqr = {
+ static const BIGNUM ossl_bignum_nist_p_384_sqr = {
(BN_ULONG *)_nist_p_384_sqr,
OSSL_NELEM(_nist_p_384_sqr),
OSSL_NELEM(_nist_p_384_sqr),
0, BN_FLG_STATIC_DATA
};
- field = &_bignum_nist_p_384; /* just to make sure */
+ field = &ossl_bignum_nist_p_384; /* just to make sure */
- if (BN_is_negative(a) || BN_ucmp(a, &_bignum_nist_p_384_sqr) >= 0)
+ if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_384_sqr) >= 0)
return BN_nnmod(r, a, field, ctx);
i = BN_ucmp(field, a);
@@ -1158,16 +1158,16 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
int top = a->top, i;
BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val, tmp, *res;
PTR_SIZE_INT mask;
- static const BIGNUM _bignum_nist_p_521_sqr = {
+ static const BIGNUM ossl_bignum_nist_p_521_sqr = {
(BN_ULONG *)_nist_p_521_sqr,
OSSL_NELEM(_nist_p_521_sqr),
OSSL_NELEM(_nist_p_521_sqr),
0, BN_FLG_STATIC_DATA
};
- field = &_bignum_nist_p_521; /* just to make sure */
+ field = &ossl_bignum_nist_p_521; /* just to make sure */
- if (BN_is_negative(a) || BN_ucmp(a, &_bignum_nist_p_521_sqr) >= 0)
+ if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_521_sqr) >= 0)
return BN_nnmod(r, a, field, ctx);
i = BN_ucmp(field, a);
@@ -1225,15 +1225,15 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a,
const BIGNUM *field, BN_CTX *ctx) {
- if (BN_ucmp(&_bignum_nist_p_192, p) == 0)
+ if (BN_ucmp(&ossl_bignum_nist_p_192, p) == 0)
return BN_nist_mod_192;
- if (BN_ucmp(&_bignum_nist_p_224, p) == 0)
+ if (BN_ucmp(&ossl_bignum_nist_p_224, p) == 0)
return BN_nist_mod_224;
- if (BN_ucmp(&_bignum_nist_p_256, p) == 0)
+ if (BN_ucmp(&ossl_bignum_nist_p_256, p) == 0)
return BN_nist_mod_256;
- if (BN_ucmp(&_bignum_nist_p_384, p) == 0)
+ if (BN_ucmp(&ossl_bignum_nist_p_384, p) == 0)
return BN_nist_mod_384;
- if (BN_ucmp(&_bignum_nist_p_521, p) == 0)
+ if (BN_ucmp(&ossl_bignum_nist_p_521, p) == 0)
return BN_nist_mod_521;
return 0;
}