summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2022-11-23 02:46:09 +0000
committerjsing <>2022-11-23 02:46:09 +0000
commit986e0f87cf7be08cd0149ec67b08f76b49e2db95 (patch)
tree69fd77864611673e435b6d416feda58e3c6cd85f
parent17daac9fa177a485e4c9a9fa74d956b9739949bc (diff)
downloadopenbsd-986e0f87cf7be08cd0149ec67b08f76b49e2db95.tar.gz
openbsd-986e0f87cf7be08cd0149ec67b08f76b49e2db95.tar.bz2
openbsd-986e0f87cf7be08cd0149ec67b08f76b49e2db95.zip
Move bn_expand() under bn_expand2().
No functional change. ok tb@
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c26
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
377BIGNUM * 377BIGNUM *
378bn_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
389BIGNUM *
378BN_dup(const BIGNUM *a) 390BN_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
490BIGNUM *
491bn_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
502int 502int
503BN_set_word(BIGNUM *a, BN_ULONG w) 503BN_set_word(BIGNUM *a, BN_ULONG w)
504{ 504{