-/* $OpenBSD: bn_convert.c,v 1.15 2023/07/09 18:37:58 tb Exp $ */
+/* $OpenBSD: bn_convert.c,v 1.16 2024/04/16 13:04:05 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
bn = BN_new();
if (bn == NULL)
goto err;
- if (!bn_expand(bn, digits * 4))
+ if (!bn_expand_bits(bn, digits * 4))
goto err;
if ((d = digits % BN_DEC_NUM) == 0)
bn = BN_new();
if (bn == NULL)
goto err;
- if (!bn_expand(bn, digits * 4))
+ if (!bn_expand_bits(bn, digits * 4))
goto err;
if (!CBS_get_bytes(cbs, cbs, digits))
-/* $OpenBSD: bn_lib.c,v 1.91 2024/04/15 14:35:25 jsing Exp $ */
+/* $OpenBSD: bn_lib.c,v 1.92 2024/04/16 13:04:05 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
}
int
-bn_expand(BIGNUM *bn, int bits)
+bn_expand_bits(BIGNUM *bn, size_t bits)
{
int words;
- if (bits < 0)
- return 0;
-
if (bits > (INT_MAX - BN_BITS2 + 1))
return 0;
-/* $OpenBSD: bn_local.h,v 1.41 2024/04/10 15:09:03 tb Exp $ */
+/* $OpenBSD: bn_local.h,v 1.42 2024/04/16 13:04:05 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
const BN_ULONG *np, const BN_ULONG *n0, int num);
void bn_correct_top(BIGNUM *a);
-int bn_expand(BIGNUM *a, int bits);
+int bn_expand_bits(BIGNUM *a, size_t bits);
int bn_wexpand(BIGNUM *a, int words);
BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,