aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn/bn_nist.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2004-03-09 03:53:40 +0000
committerGeoff Thorpe <geoff@openssl.org>2004-03-09 03:53:40 +0000
commita8aa764d3c96eb65b22863cdc5f6ab08d92dd355 (patch)
treef6b27ded43690e9ada28fb27ceba23ba3ea25431 /crypto/bn/bn_nist.c
parente7716b7a197d551a22dfdb4df6021db8e92bae5d (diff)
downloadopenssl-a8aa764d3c96eb65b22863cdc5f6ab08d92dd355.zip
openssl-a8aa764d3c96eb65b22863cdc5f6ab08d92dd355.tar.gz
openssl-a8aa764d3c96eb65b22863cdc5f6ab08d92dd355.tar.bz2
Minimise the amount of code dependent on BN_DEBUG_RAND. In particular,
redefine bn_clear_top2max() to be a NOP in the non-debugging case, and remove some unnecessary usages in bn_nist.c. Submitted by: Nils Larsch Reviewed by: Geoff Thorpe, Ulf Möller
Diffstat (limited to 'crypto/bn/bn_nist.c')
-rw-r--r--crypto/bn/bn_nist.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c
index f30f6c6..a29503b 100644
--- a/crypto/bn/bn_nist.c
+++ b/crypto/bn/bn_nist.c
@@ -359,12 +359,7 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
--carry;
}
r->top = BN_NIST_192_TOP;
-
-#if 1
- bn_clear_top2max(r);
-#endif
bn_correct_top(r);
-
if (BN_ucmp(r, field) >= 0)
{
bn_sub_words(r_d, r_d, _nist_p_192, BN_NIST_192_TOP);
@@ -453,11 +448,7 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
}
r->top = BN_NIST_224_TOP;
-#if 1
- bn_clear_top2max(r);
-#endif
bn_correct_top(r);
-
if (BN_ucmp(r, field) >= 0)
{
bn_sub_words(r_d, r_d, _nist_p_224, BN_NIST_224_TOP);
@@ -612,11 +603,7 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
}
r->top = BN_NIST_256_TOP;
-#if 1
- bn_clear_top2max(r);
-#endif
bn_correct_top(r);
-
if (BN_ucmp(r, field) >= 0)
{
bn_sub_words(r_d, r_d, _nist_p_256, BN_NIST_256_TOP);
@@ -781,11 +768,7 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
}
r->top = BN_NIST_384_TOP;
-#if 1
- bn_clear_top2max(r);
-#endif
bn_correct_top(r);
-
if (BN_ucmp(r, field) >= 0)
{
bn_sub_words(r_d, r_d, _nist_p_384, BN_NIST_384_TOP);