aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-01-27 11:26:28 +0000
committerBodo Möller <bodo@openssl.org>2000-01-27 11:26:28 +0000
commit6e0cad8d34700c82d1c3749cee6a0fa1683dcd5f (patch)
tree1521156d438a6bddef52daf99c31f6b078a5ee27 /crypto
parent5f5e96d92b249c27cf0236c4ef754ca2e04c23e7 (diff)
downloadopenssl-6e0cad8d34700c82d1c3749cee6a0fa1683dcd5f.tar.gz
enable Montgomery test
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bn/bntest.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c
index 78fd325383..7a0e154d34 100644
--- a/crypto/bn/bntest.c
+++ b/crypto/bn/bntest.c
@@ -202,11 +202,10 @@ int main(int argc, char *argv[])
if (!test_mod_mul(out,ctx)) goto err;
fflush(stdout);
-/*
fprintf(stderr,"test BN_mont\n");
if (!test_mont(out,ctx)) goto err;
fflush(stdout);
-*/
+
fprintf(stderr,"test BN_mod_exp\n");
if (!test_mod_exp(out,ctx)) goto err;
fflush(stdout);
@@ -570,7 +569,11 @@ int test_mont(BIO *bp, BN_CTX *ctx)
BN_rand(&b,100,0,0); /**/
for (i=0; i<10; i++)
{
- BN_rand(&n,(100%BN_BITS2+1)*BN_BITS2*i*BN_BITS2,0,1); /**/
+ int bits = (100%BN_BITS2+1)*BN_BITS2*i*BN_BITS2;
+
+ if (bits == 0)
+ continue;
+ BN_rand(&n,bits,0,1);
BN_MONT_CTX_set(mont,&n,ctx);
BN_to_montgomery(&A,&a,mont,ctx);