diff options
author | Bodo Möller <bodo@openssl.org> | 2000-11-29 19:26:33 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-11-29 19:26:33 +0000 |
commit | eb1f1b0a341cbe2c75d8f24b2dc62f4cad05dcec (patch) | |
tree | 0283e16350c453a812e800021a182dbf98b1d3fa /crypto/bn/bntest.c | |
parent | a9376dbff94c9ddd06639264389ae9777bcb2d30 (diff) |
Fix BN_kronecker so that it works correctly if 'a' is negative
(we need the two's complement of BN_lsw then).
Diffstat (limited to 'crypto/bn/bntest.c')
-rw-r--r-- | crypto/bn/bntest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c index 9e478dfe24..a664f3b91a 100644 --- a/crypto/bn/bntest.c +++ b/crypto/bn/bntest.c @@ -949,8 +949,8 @@ int test_kron(BIO *bp, BN_CTX *ctx) for (i = 0; i < num0; i++) { if (!BN_rand(a, 512, 0, 0)) goto err; - if (!BN_nnmod(a, a, b, ctx)) goto err; - + a->neg = rand_neg(); + /* r := (b-1)/2 (note that b is odd) */ if (!BN_copy(r, b)) goto err; if (!BN_sub_word(r, 1)) goto err; |