diff options
author | Andy Polyakov <appro@openssl.org> | 2007-07-08 18:54:30 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2007-07-08 18:54:30 +0000 |
commit | 5a84b7fc2db33cdefc5a7b62f0169f2c08fb3d9b (patch) | |
tree | b3648c491bfc36c01464a0487629f7e0f3a5b880 /crypto/bn | |
parent | d8e660a6dcbc15f53d526cb44c8659a3e59b24c1 (diff) |
bn_mul_recursive doesn't handle all cases correctly, which results in
BN_mul failures at certain key-length mixes [from HEAD].
PR: 1427
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/bn_mul.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c index aec1eafc65..312b467645 100644 --- a/crypto/bn/bn_mul.c +++ b/crypto/bn/bn_mul.c @@ -655,16 +655,16 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, for (;;) { i/=2; - if (i < tna && i < tnb) + if (i <= tna && tna == tnb) { - bn_mul_part_recursive(&(r[n2]), + bn_mul_recursive(&(r[n2]), &(a[n]),&(b[n]), i,tna-i,tnb-i,p); break; } - else if (i <= tna && i <= tnb) + else if (i < tna || i < tnb) { - bn_mul_recursive(&(r[n2]), + bn_mul_part_recursive(&(r[n2]), &(a[n]),&(b[n]), i,tna-i,tnb-i,p); break; |