diff options
author | jsing <> | 2022-11-23 03:10:10 +0000 |
---|---|---|
committer | jsing <> | 2022-11-23 03:10:10 +0000 |
commit | 18fd3b0a66fb6b89d05631662dad5467cb0ee3bb (patch) | |
tree | ebbcc77732029817b196e897af247c3a859a9ce9 /src/lib/libcrypto/bn/bn_mont.c | |
parent | bc4574576aa870ae46b89eb9506a76cdccea8db2 (diff) | |
download | openbsd-18fd3b0a66fb6b89d05631662dad5467cb0ee3bb.tar.gz openbsd-18fd3b0a66fb6b89d05631662dad5467cb0ee3bb.tar.bz2 openbsd-18fd3b0a66fb6b89d05631662dad5467cb0ee3bb.zip |
Use bn_wexpand() rather than bn_expand() with sizeof(BN_ULONG).
This also fixes a bug in BN_MONT_CTX_set(), where the sizeof(BN_ULONG) in
the call to bn_expand() was not multiplied by eight (to get bits).
ok tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_mont.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_mont.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index e01af702e7..4555f6146b 100644 --- a/src/lib/libcrypto/bn/bn_mont.c +++ b/src/lib/libcrypto/bn/bn_mont.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_mont.c,v 1.28 2022/02/07 19:44:23 tb Exp $ */ | 1 | /* $OpenBSD: bn_mont.c,v 1.29 2022/11/23 03:10:10 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -419,7 +419,7 @@ BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) | |||
419 | } | 419 | } |
420 | else /* if N mod word size == 1 */ | 420 | else /* if N mod word size == 1 */ |
421 | { | 421 | { |
422 | if (bn_expand(Ri, (int)sizeof(BN_ULONG) * 2) == NULL) | 422 | if (bn_wexpand(Ri, 2) == NULL) |
423 | goto err; | 423 | goto err; |
424 | /* Ri-- (mod double word size) */ | 424 | /* Ri-- (mod double word size) */ |
425 | Ri->neg = 0; | 425 | Ri->neg = 0; |