summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn')
-rw-r--r--src/lib/libcrypto/bn/bn_add.c5
-rw-r--r--src/lib/libcrypto/bn/bn_convert.c4
-rw-r--r--src/lib/libcrypto/bn/bn_ctx.c4
-rw-r--r--src/lib/libcrypto/bn/bn_div.c4
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c5
-rw-r--r--src/lib/libcrypto/bn/bn_gcd.c5
-rw-r--r--src/lib/libcrypto/bn/bn_isqrt.c4
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c5
-rw-r--r--src/lib/libcrypto/bn/bn_mod.c5
-rw-r--r--src/lib/libcrypto/bn/bn_mod_sqrt.c5
-rw-r--r--src/lib/libcrypto/bn/bn_prime.c5
-rw-r--r--src/lib/libcrypto/bn/bn_rand.c5
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c5
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c4
14 files changed, 28 insertions, 37 deletions
diff --git a/src/lib/libcrypto/bn/bn_add.c b/src/lib/libcrypto/bn/bn_add.c
index 86768a312a..79fc1db41e 100644
--- a/src/lib/libcrypto/bn/bn_add.c
+++ b/src/lib/libcrypto/bn/bn_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_add.c,v 1.26 2023/07/08 12:21:58 beck Exp $ */ 1/* $OpenBSD: bn_add.c,v 1.27 2025/05/10 05:54:38 tb 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 *
@@ -60,11 +60,10 @@
60#include <limits.h> 60#include <limits.h>
61#include <stdio.h> 61#include <stdio.h>
62 62
63#include <openssl/err.h>
64
65#include "bn_arch.h" 63#include "bn_arch.h"
66#include "bn_local.h" 64#include "bn_local.h"
67#include "bn_internal.h" 65#include "bn_internal.h"
66#include "err_local.h"
68 67
69/* 68/*
70 * bn_add_words() computes (carry:r[i]) = a[i] + b[i] + carry, where a and b 69 * bn_add_words() computes (carry:r[i]) = a[i] + b[i] + carry, where a and b
diff --git a/src/lib/libcrypto/bn/bn_convert.c b/src/lib/libcrypto/bn/bn_convert.c
index 6a6354f44e..ca5c7d7865 100644
--- a/src/lib/libcrypto/bn/bn_convert.c
+++ b/src/lib/libcrypto/bn/bn_convert.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_convert.c,v 1.23 2024/11/08 14:18:44 jsing Exp $ */ 1/* $OpenBSD: bn_convert.c,v 1.24 2025/05/10 05:54:38 tb 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 *
@@ -65,11 +65,11 @@
65 65
66#include <openssl/bio.h> 66#include <openssl/bio.h>
67#include <openssl/buffer.h> 67#include <openssl/buffer.h>
68#include <openssl/err.h>
69 68
70#include "bn_local.h" 69#include "bn_local.h"
71#include "bytestring.h" 70#include "bytestring.h"
72#include "crypto_internal.h" 71#include "crypto_internal.h"
72#include "err_local.h"
73 73
74static int bn_dec2bn_cbs(BIGNUM **bnp, CBS *cbs); 74static int bn_dec2bn_cbs(BIGNUM **bnp, CBS *cbs);
75static int bn_hex2bn_cbs(BIGNUM **bnp, CBS *cbs); 75static int bn_hex2bn_cbs(BIGNUM **bnp, CBS *cbs);
diff --git a/src/lib/libcrypto/bn/bn_ctx.c b/src/lib/libcrypto/bn/bn_ctx.c
index 129b9c9781..eda93dcaa4 100644
--- a/src/lib/libcrypto/bn/bn_ctx.c
+++ b/src/lib/libcrypto/bn/bn_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_ctx.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ 1/* $OpenBSD: bn_ctx.c,v 1.23 2025/05/10 05:54:38 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -19,9 +19,9 @@
19#include <string.h> 19#include <string.h>
20 20
21#include <openssl/opensslconf.h> 21#include <openssl/opensslconf.h>
22#include <openssl/err.h>
23 22
24#include "bn_local.h" 23#include "bn_local.h"
24#include "err_local.h"
25 25
26#define BN_CTX_INITIAL_LEN 8 26#define BN_CTX_INITIAL_LEN 8
27 27
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index 09a8a364df..1026b43add 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.41 2024/04/10 14:58:06 beck Exp $ */ 1/* $OpenBSD: bn_div.c,v 1.42 2025/05/10 05:54:38 tb 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 *
@@ -62,11 +62,11 @@
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h>
66 65
67#include "bn_arch.h" 66#include "bn_arch.h"
68#include "bn_local.h" 67#include "bn_local.h"
69#include "bn_internal.h" 68#include "bn_internal.h"
69#include "err_local.h"
70 70
71BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0); 71BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0);
72 72
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index e925d325d2..6a5c1c857a 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.58 2025/02/13 11:15:09 tb Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.59 2025/05/10 05:54:38 tb 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 *
@@ -112,10 +112,9 @@
112#include <stdlib.h> 112#include <stdlib.h>
113#include <string.h> 113#include <string.h>
114 114
115#include <openssl/err.h>
116
117#include "bn_local.h" 115#include "bn_local.h"
118#include "constant_time.h" 116#include "constant_time.h"
117#include "err_local.h"
119 118
120/* maximum precomputation table size for *variable* sliding windows */ 119/* maximum precomputation table size for *variable* sliding windows */
121#define TABLE_SIZE 32 120#define TABLE_SIZE 32
diff --git a/src/lib/libcrypto/bn/bn_gcd.c b/src/lib/libcrypto/bn/bn_gcd.c
index fa5d71a7f3..aaf1dbe4a9 100644
--- a/src/lib/libcrypto/bn/bn_gcd.c
+++ b/src/lib/libcrypto/bn/bn_gcd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gcd.c,v 1.29 2024/04/10 14:58:06 beck Exp $ */ 1/* $OpenBSD: bn_gcd.c,v 1.30 2025/05/10 05:54:38 tb 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 *
@@ -109,9 +109,8 @@
109 * 109 *
110 */ 110 */
111 111
112#include <openssl/err.h>
113
114#include "bn_local.h" 112#include "bn_local.h"
113#include "err_local.h"
115 114
116static BIGNUM * 115static BIGNUM *
117euclid(BIGNUM *a, BIGNUM *b) 116euclid(BIGNUM *a, BIGNUM *b)
diff --git a/src/lib/libcrypto/bn/bn_isqrt.c b/src/lib/libcrypto/bn/bn_isqrt.c
index 018d5f34bd..b725519e1a 100644
--- a/src/lib/libcrypto/bn/bn_isqrt.c
+++ b/src/lib/libcrypto/bn/bn_isqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_isqrt.c,v 1.10 2023/06/04 17:28:35 tb Exp $ */ 1/* $OpenBSD: bn_isqrt.c,v 1.11 2025/05/10 05:54:38 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -19,10 +19,10 @@
19#include <stdint.h> 19#include <stdint.h>
20 20
21#include <openssl/bn.h> 21#include <openssl/bn.h>
22#include <openssl/err.h>
23 22
24#include "bn_local.h" 23#include "bn_local.h"
25#include "crypto_internal.h" 24#include "crypto_internal.h"
25#include "err_local.h"
26 26
27/* 27/*
28 * Calculate integer square root of |n| using a variant of Newton's method. 28 * Calculate integer square root of |n| using a variant of Newton's method.
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 72b988650c..3e451a6191 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.93 2024/04/16 13:07:14 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.94 2025/05/10 05:54:38 tb 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 *
@@ -63,10 +63,9 @@
63 63
64#include <openssl/opensslconf.h> 64#include <openssl/opensslconf.h>
65 65
66#include <openssl/err.h>
67
68#include "bn_local.h" 66#include "bn_local.h"
69#include "bn_internal.h" 67#include "bn_internal.h"
68#include "err_local.h"
70 69
71BIGNUM * 70BIGNUM *
72BN_new(void) 71BN_new(void)
diff --git a/src/lib/libcrypto/bn/bn_mod.c b/src/lib/libcrypto/bn/bn_mod.c
index 365f6fcf03..7198c02e3b 100644
--- a/src/lib/libcrypto/bn/bn_mod.c
+++ b/src/lib/libcrypto/bn/bn_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ 1/* $OpenBSD: bn_mod.c,v 1.23 2025/05/10 05:54:38 tb Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. */ 3 * for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -111,9 +111,8 @@
111 * [including the GNU Public Licence.] 111 * [including the GNU Public Licence.]
112 */ 112 */
113 113
114#include <openssl/err.h>
115
116#include "bn_local.h" 114#include "bn_local.h"
115#include "err_local.h"
117 116
118int 117int
119BN_mod_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) 118BN_mod_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
diff --git a/src/lib/libcrypto/bn/bn_mod_sqrt.c b/src/lib/libcrypto/bn/bn_mod_sqrt.c
index 280002cc48..fc55f84317 100644
--- a/src/lib/libcrypto/bn/bn_mod_sqrt.c
+++ b/src/lib/libcrypto/bn/bn_mod_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod_sqrt.c,v 1.3 2023/08/03 18:53:55 tb Exp $ */ 1/* $OpenBSD: bn_mod_sqrt.c,v 1.4 2025/05/10 05:54:38 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -16,9 +16,8 @@
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19#include <openssl/err.h>
20
21#include "bn_local.h" 19#include "bn_local.h"
20#include "err_local.h"
22 21
23/* 22/*
24 * Tonelli-Shanks according to H. Cohen "A Course in Computational Algebraic 23 * Tonelli-Shanks according to H. Cohen "A Course in Computational Algebraic
diff --git a/src/lib/libcrypto/bn/bn_prime.c b/src/lib/libcrypto/bn/bn_prime.c
index 5a4aa50bf1..d85595e0dd 100644
--- a/src/lib/libcrypto/bn/bn_prime.c
+++ b/src/lib/libcrypto/bn/bn_prime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_prime.c,v 1.34 2023/07/20 06:26:27 tb Exp $ */ 1/* $OpenBSD: bn_prime.c,v 1.35 2025/05/10 05:54:38 tb 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 *
@@ -112,9 +112,8 @@
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114 114
115#include <openssl/err.h>
116
117#include "bn_local.h" 115#include "bn_local.h"
116#include "err_local.h"
118 117
119/* The quick sieve algorithm approach to weeding out primes is 118/* The quick sieve algorithm approach to weeding out primes is
120 * Philip Zimmermann's, as implemented in PGP. I have had a read of 119 * Philip Zimmermann's, as implemented in PGP. I have had a read of
diff --git a/src/lib/libcrypto/bn/bn_rand.c b/src/lib/libcrypto/bn/bn_rand.c
index 9cfcd8e2c0..d3b16f70a0 100644
--- a/src/lib/libcrypto/bn/bn_rand.c
+++ b/src/lib/libcrypto/bn/bn_rand.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_rand.c,v 1.30 2024/03/16 20:42:33 tb Exp $ */ 1/* $OpenBSD: bn_rand.c,v 1.31 2025/05/10 05:54:38 tb 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 *
@@ -115,9 +115,8 @@
115#include <string.h> 115#include <string.h>
116#include <time.h> 116#include <time.h>
117 117
118#include <openssl/err.h>
119
120#include "bn_local.h" 118#include "bn_local.h"
119#include "err_local.h"
121 120
122static int 121static int
123bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) 122bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index e3f22c52a9..ed5049b772 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.33 2025/02/04 20:22:20 tb Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.34 2025/05/10 05:54:38 tb 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 *
@@ -58,9 +58,8 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60 60
61#include <openssl/err.h>
62
63#include "bn_local.h" 61#include "bn_local.h"
62#include "err_local.h"
64 63
65struct bn_recp_ctx_st { 64struct bn_recp_ctx_st {
66 BIGNUM *N; /* the divisor */ 65 BIGNUM *N; /* the divisor */
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index 12edc7c0a0..b9f73cc322 100644
--- a/src/lib/libcrypto/bn/bn_shift.c
+++ b/src/lib/libcrypto/bn/bn_shift.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_shift.c,v 1.22 2023/07/08 12:21:58 beck Exp $ */ 1/* $OpenBSD: bn_shift.c,v 1.23 2025/05/10 05:54:38 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2022, 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -16,9 +16,9 @@
16 */ 16 */
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/err.h>
20 19
21#include "bn_local.h" 20#include "bn_local.h"
21#include "err_local.h"
22 22
23static inline int 23static inline int
24bn_lshift(BIGNUM *r, const BIGNUM *a, int n) 24bn_lshift(BIGNUM *r, const BIGNUM *a, int n)