diff options
| author | jsing <> | 2022-11-23 02:46:09 +0000 |
|---|---|---|
| committer | jsing <> | 2022-11-23 02:46:09 +0000 |
| commit | 01bec6796e5504ea8fb46df37a667b4aaf5f9cb3 (patch) | |
| tree | 69fd77864611673e435b6d416feda58e3c6cd85f /src | |
| parent | 4d9c5ddf10f5abfcc516cf4ba2a184750ef7c644 (diff) | |
| download | openbsd-01bec6796e5504ea8fb46df37a667b4aaf5f9cb3.tar.gz openbsd-01bec6796e5504ea8fb46df37a667b4aaf5f9cb3.tar.bz2 openbsd-01bec6796e5504ea8fb46df37a667b4aaf5f9cb3.zip | |
Move bn_expand() under bn_expand2().
No functional change.
ok tb@
Diffstat (limited to '')
| -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 | { |
