diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index df43da5db6..851c337ef0 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.65 2022/11/30 02:52:25 jsing Exp $ */ | 1 | /* $OpenBSD: bn_lib.c,v 1.66 2022/11/30 03:08:39 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 | * |
@@ -253,6 +253,13 @@ BN_num_bits(const BIGNUM *a) | |||
253 | return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); | 253 | return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); |
254 | } | 254 | } |
255 | 255 | ||
256 | void | ||
257 | bn_correct_top(BIGNUM *a) | ||
258 | { | ||
259 | while (a->top > 0 && a->d[a->top - 1] == 0) | ||
260 | a->top--; | ||
261 | } | ||
262 | |||
256 | /* The caller MUST check that words > b->dmax before calling this */ | 263 | /* The caller MUST check that words > b->dmax before calling this */ |
257 | static BN_ULONG * | 264 | static BN_ULONG * |
258 | bn_expand_internal(const BIGNUM *b, int words) | 265 | bn_expand_internal(const BIGNUM *b, int words) |