diff options
author | Ulf Möller <ulf@openssl.org> | 2000-02-25 22:08:37 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-02-25 22:08:37 +0000 |
commit | 582afb4bd705fd971be6a28c8b588e1e413e07da (patch) | |
tree | bead138d9aa2d5a4762d16e53cc79c76c23270b7 /crypto/bn | |
parent | f63500c09c228e60412de140ba3967ab8731b366 (diff) |
flush output.
Looks like it fails when b is a power of 2, but I never get incorrect
results.
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/divtest.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/bn/divtest.c b/crypto/bn/divtest.c index bb301680c0..60b3d662d9 100644 --- a/crypto/bn/divtest.c +++ b/crypto/bn/divtest.c @@ -3,7 +3,7 @@ int rand(n) { unsigned char x[2]; - RAND_bytes(&x,2); + RAND_pseudo_bytes(&x,2); return (x[0] + 2*x[1]); } @@ -14,6 +14,7 @@ void bug(char *m, BIGNUM *a, BIGNUM *b) printf("\nb="); BN_print_fp(stdout, b); printf("\n"); + fflush(stdout); } main() @@ -24,8 +25,8 @@ main() BN_CTX *ctx=BN_CTX_new(); for(;;) { - BN_rand(a,rand(),0,0); - BN_rand(b,rand(),0,0); + BN_pseudo_rand(a,rand(),0,0); + BN_pseudo_rand(b,rand(),0,0); if (BN_is_zero(b)) continue; BN_RECP_CTX_set(recp,b,ctx); |