diff options
author | jsing <> | 2022-11-23 02:46:09 +0000 |
---|---|---|
committer | jsing <> | 2022-11-23 02:46:09 +0000 |
commit | 986e0f87cf7be08cd0149ec67b08f76b49e2db95 (patch) | |
tree | 69fd77864611673e435b6d416feda58e3c6cd85f /src/lib | |
parent | 17daac9fa177a485e4c9a9fa74d956b9739949bc (diff) | |
download | openbsd-986e0f87cf7be08cd0149ec67b08f76b49e2db95.tar.gz openbsd-986e0f87cf7be08cd0149ec67b08f76b49e2db95.tar.bz2 openbsd-986e0f87cf7be08cd0149ec67b08f76b49e2db95.zip |
Move bn_expand() under bn_expand2().
No functional change.
ok tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index 18b213ff78..7ec338b926 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.56 2022/11/23 02:44:01 jsing Exp $ */ | 1 | /* $OpenBSD: bn_lib.c,v 1.57 2022/11/23 02:46:09 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 | * |
@@ -375,6 +375,18 @@ bn_expand2(BIGNUM *b, int words) | |||
375 | } | 375 | } |
376 | 376 | ||
377 | BIGNUM * | 377 | BIGNUM * |
378 | bn_expand(BIGNUM *a, int bits) | ||
379 | { | ||
380 | if (bits > (INT_MAX - BN_BITS2 + 1)) | ||
381 | return (NULL); | ||
382 | |||
383 | if (((bits + BN_BITS2 - 1) / BN_BITS2) <= a->dmax) | ||
384 | return (a); | ||
385 | |||
386 | return bn_expand2(a, (bits + BN_BITS2 - 1) / BN_BITS2); | ||
387 | } | ||
388 | |||
389 | BIGNUM * | ||
378 | BN_dup(const BIGNUM *a) | 390 | BN_dup(const BIGNUM *a) |
379 | { | 391 | { |
380 | BIGNUM *t; | 392 | BIGNUM *t; |
@@ -487,18 +499,6 @@ BN_get_word(const BIGNUM *a) | |||
487 | return 0; | 499 | return 0; |
488 | } | 500 | } |
489 | 501 | ||
490 | BIGNUM * | ||
491 | bn_expand(BIGNUM *a, int bits) | ||
492 | { | ||
493 | if (bits > (INT_MAX - BN_BITS2 + 1)) | ||
494 | return (NULL); | ||
495 | |||
496 | if (((bits + BN_BITS2 - 1) / BN_BITS2) <= a->dmax) | ||
497 | return (a); | ||
498 | |||
499 | return bn_expand2(a, (bits + BN_BITS2 - 1) / BN_BITS2); | ||
500 | } | ||
501 | |||
502 | int | 502 | int |
503 | BN_set_word(BIGNUM *a, BN_ULONG w) | 503 | BN_set_word(BIGNUM *a, BN_ULONG w) |
504 | { | 504 | { |