summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-12-06 18:23:29 +0000
committertb <>2022-12-06 18:23:29 +0000
commit25379fab64d0e4e97e49ce782d1f7239af8a6192 (patch)
tree3d7a75b4695a187d73d96688171cae5e85928f1f /src
parent63e1e004d5a60eea51f7c1fcc42d54aca4f605b9 (diff)
downloadopenbsd-25379fab64d0e4e97e49ce782d1f7239af8a6192.tar.gz
openbsd-25379fab64d0e4e97e49ce782d1f7239af8a6192.tar.bz2
openbsd-25379fab64d0e4e97e49ce782d1f7239af8a6192.zip
Add a few missing headers and drop a few unused ones
In bn_test.c include bn_local.h instead of using copy-pasted prototypes.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/bn/bn_isqrt.c5
-rw-r--r--src/regress/lib/libcrypto/bn/bn_mod_sqrt.c4
-rw-r--r--src/regress/lib/libcrypto/bn/bn_mont.c5
-rw-r--r--src/regress/lib/libcrypto/bn/bn_primes.c6
-rw-r--r--src/regress/lib/libcrypto/bn/bn_test.c14
-rw-r--r--src/regress/lib/libcrypto/bn/bn_to_string.c3
-rw-r--r--src/regress/lib/libcrypto/bn/bn_unit.c3
7 files changed, 20 insertions, 20 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_isqrt.c b/src/regress/lib/libcrypto/bn/bn_isqrt.c
index a730322082..b1cacea1cd 100644
--- a/src/regress/lib/libcrypto/bn/bn_isqrt.c
+++ b/src/regress/lib/libcrypto/bn/bn_isqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_isqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_isqrt.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -16,6 +16,9 @@
16 */ 16 */
17 17
18#include <err.h> 18#include <err.h>
19#include <stdint.h>
20#include <stdio.h>
21#include <stdlib.h>
19#include <string.h> 22#include <string.h>
20#include <unistd.h> 23#include <unistd.h>
21 24
diff --git a/src/regress/lib/libcrypto/bn/bn_mod_sqrt.c b/src/regress/lib/libcrypto/bn/bn_mod_sqrt.c
index e193755b74..7757c2a1ca 100644
--- a/src/regress/lib/libcrypto/bn/bn_mod_sqrt.c
+++ b/src/regress/lib/libcrypto/bn/bn_mod_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -15,6 +15,8 @@
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17 17
18#include <stdio.h>
19
18#include <openssl/bn.h> 20#include <openssl/bn.h>
19 21
20/* Test that sqrt * sqrt = A (mod p) where p is a prime */ 22/* Test that sqrt * sqrt = A (mod p) where p is a prime */
diff --git a/src/regress/lib/libcrypto/bn/bn_mont.c b/src/regress/lib/libcrypto/bn/bn_mont.c
index d7c8f9581d..4bcc79d183 100644
--- a/src/regress/lib/libcrypto/bn/bn_mont.c
+++ b/src/regress/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014 Miodrag Vallat. 4 * Copyright (c) 2014 Miodrag Vallat.
@@ -16,10 +16,9 @@
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 <err.h>
19#include <stdio.h> 20#include <stdio.h>
20#include <stdlib.h> 21#include <stdlib.h>
21#include <string.h>
22#include <err.h>
23 22
24#include <openssl/bn.h> 23#include <openssl/bn.h>
25#include <openssl/crypto.h> 24#include <openssl/crypto.h>
diff --git a/src/regress/lib/libcrypto/bn/bn_primes.c b/src/regress/lib/libcrypto/bn/bn_primes.c
index e9a91ba87a..cd552dc3ac 100644
--- a/src/regress/lib/libcrypto/bn/bn_primes.c
+++ b/src/regress/lib/libcrypto/bn/bn_primes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_primes.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_primes.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -15,6 +15,10 @@
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17 17
18#include <stdint.h>
19#include <stdio.h>
20#include <stdlib.h>
21
18#include <openssl/bn.h> 22#include <openssl/bn.h>
19 23
20#include "bn_prime.h" 24#include "bn_prime.h"
diff --git a/src/regress/lib/libcrypto/bn/bn_test.c b/src/regress/lib/libcrypto/bn/bn_test.c
index c1feddeda1..ed61f86f2e 100644
--- a/src/regress/lib/libcrypto/bn/bn_test.c
+++ b/src/regress/lib/libcrypto/bn/bn_test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_test.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_test.c,v 1.2 2022/12/06 18:23:29 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 *
@@ -81,19 +81,9 @@
81 81
82#include <openssl/bio.h> 82#include <openssl/bio.h>
83#include <openssl/bn.h> 83#include <openssl/bn.h>
84#include <openssl/x509.h>
85#include <openssl/err.h> 84#include <openssl/err.h>
86 85
87int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 86#include "bn_local.h"
88 const BIGNUM *m, BN_CTX *ctx);
89int BN_mod_exp_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
90 const BIGNUM *m, BN_CTX *ctx);
91int BN_mod_exp_mont_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
92 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
93int BN_mod_exp_mont_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
94 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
95
96int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
97 87
98const int num0 = 100; /* number of tests */ 88const int num0 = 100; /* number of tests */
99const int num1 = 50; /* additional tests for some functions */ 89const int num1 = 50; /* additional tests for some functions */
diff --git a/src/regress/lib/libcrypto/bn/bn_to_string.c b/src/regress/lib/libcrypto/bn/bn_to_string.c
index ca5ca2f08d..2275f98de9 100644
--- a/src/regress/lib/libcrypto/bn/bn_to_string.c
+++ b/src/regress/lib/libcrypto/bn/bn_to_string.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_to_string.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_to_string.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2019 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -17,6 +17,7 @@
17 17
18#include <err.h> 18#include <err.h>
19#include <stdio.h> 19#include <stdio.h>
20#include <stdlib.h>
20#include <string.h> 21#include <string.h>
21 22
22#include <openssl/bn.h> 23#include <openssl/bn.h>
diff --git a/src/regress/lib/libcrypto/bn/bn_unit.c b/src/regress/lib/libcrypto/bn/bn_unit.c
index b4e4a776de..1af3e8868d 100644
--- a/src/regress/lib/libcrypto/bn/bn_unit.c
+++ b/src/regress/lib/libcrypto/bn/bn_unit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_unit.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ 1/* $OpenBSD: bn_unit.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -18,6 +18,7 @@
18 18
19#include <err.h> 19#include <err.h>
20#include <limits.h> 20#include <limits.h>
21#include <stdio.h>
21#include <stdlib.h> 22#include <stdlib.h>
22#include <string.h> 23#include <string.h>
23 24