diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_internal.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn_internal.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_internal.h b/src/lib/libcrypto/bn/bn_internal.h index fd04bc9f8a..8b5145e225 100644 --- a/src/lib/libcrypto/bn/bn_internal.h +++ b/src/lib/libcrypto/bn/bn_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_internal.h,v 1.15 2023/06/25 11:42:26 jsing Exp $ */ | 1 | /* $OpenBSD: bn_internal.h,v 1.20 2025/08/02 16:20:00 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -26,6 +26,30 @@ int bn_word_clz(BN_ULONG w); | |||
26 | 26 | ||
27 | int bn_bitsize(const BIGNUM *bn); | 27 | int bn_bitsize(const BIGNUM *bn); |
28 | 28 | ||
29 | BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
30 | int num); | ||
31 | BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
32 | int num); | ||
33 | BN_ULONG bn_sub_words_borrow(const BN_ULONG *a, const BN_ULONG *b, size_t n); | ||
34 | BN_ULONG bn_add_words_masked(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
35 | BN_ULONG mask, size_t n); | ||
36 | BN_ULONG bn_sub_words_masked(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
37 | BN_ULONG mask, size_t n); | ||
38 | void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
39 | const BN_ULONG *m, size_t n); | ||
40 | void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
41 | const BN_ULONG *m, size_t n); | ||
42 | void bn_mod_mul_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, | ||
43 | const BN_ULONG *m, BN_ULONG *t, BN_ULONG m0, size_t n); | ||
44 | void bn_mod_sqr_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *m, | ||
45 | BN_ULONG *t, BN_ULONG m0, size_t n); | ||
46 | |||
47 | void bn_montgomery_multiply_words(BN_ULONG *rp, const BN_ULONG *ap, | ||
48 | const BN_ULONG *bp, const BN_ULONG *np, BN_ULONG *tp, BN_ULONG n0, | ||
49 | int n_len); | ||
50 | void bn_montgomery_reduce_words(BN_ULONG *r, BN_ULONG *a, const BN_ULONG *n, | ||
51 | BN_ULONG n0, int n_len); | ||
52 | |||
29 | #ifndef HAVE_BN_CT_NE_ZERO | 53 | #ifndef HAVE_BN_CT_NE_ZERO |
30 | static inline int | 54 | static inline int |
31 | bn_ct_ne_zero(BN_ULONG w) | 55 | bn_ct_ne_zero(BN_ULONG w) |