diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index 7ec338b926..7c85e7ad08 100644 --- a/src/lib/libcrypto/bn/bn_lib.c +++ b/src/lib/libcrypto/bn/bn_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_lib.c,v 1.57 2022/11/23 02:46:09 jsing Exp $ */ | 1 | /* $OpenBSD: bn_lib.c,v 1.58 2022/11/23 03:00:12 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 | * |
@@ -334,7 +334,7 @@ bn_expand_internal(const BIGNUM *b, int words) | |||
334 | * It is mostly used by the various BIGNUM routines. If there is an error, | 334 | * It is mostly used by the various BIGNUM routines. If there is an error, |
335 | * NULL is returned. If not, 'b' is returned. */ | 335 | * NULL is returned. If not, 'b' is returned. */ |
336 | 336 | ||
337 | BIGNUM * | 337 | static BIGNUM * |
338 | bn_expand2(BIGNUM *b, int words) | 338 | bn_expand2(BIGNUM *b, int words) |
339 | { | 339 | { |
340 | bn_check_top(b); | 340 | bn_check_top(b); |
@@ -387,6 +387,15 @@ bn_expand(BIGNUM *a, int bits) | |||
387 | } | 387 | } |
388 | 388 | ||
389 | BIGNUM * | 389 | BIGNUM * |
390 | bn_wexpand(BIGNUM *a, int words) | ||
391 | { | ||
392 | if (words <= a->dmax) | ||
393 | return a; | ||
394 | |||
395 | return bn_expand2(a, words); | ||
396 | } | ||
397 | |||
398 | BIGNUM * | ||
390 | BN_dup(const BIGNUM *a) | 399 | BN_dup(const BIGNUM *a) |
391 | { | 400 | { |
392 | BIGNUM *t; | 401 | BIGNUM *t; |