From 25379fab64d0e4e97e49ce782d1f7239af8a6192 Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 6 Dec 2022 18:23:29 +0000 Subject: 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. --- src/regress/lib/libcrypto/bn/bn_isqrt.c | 5 ++++- src/regress/lib/libcrypto/bn/bn_mod_sqrt.c | 4 +++- src/regress/lib/libcrypto/bn/bn_mont.c | 5 ++--- src/regress/lib/libcrypto/bn/bn_primes.c | 6 +++++- src/regress/lib/libcrypto/bn/bn_test.c | 14 ++------------ src/regress/lib/libcrypto/bn/bn_to_string.c | 3 ++- src/regress/lib/libcrypto/bn/bn_unit.c | 3 ++- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/regress/lib/libcrypto') 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 @@ -/* $OpenBSD: bn_isqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_isqrt.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -16,6 +16,9 @@ */ #include +#include +#include +#include #include #include 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 @@ -/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -15,6 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + #include /* 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 @@ -/* $OpenBSD: bn_mont.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_mont.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* * Copyright (c) 2014 Miodrag Vallat. @@ -16,10 +16,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include #include -#include -#include #include #include 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 @@ -/* $OpenBSD: bn_primes.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_primes.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * @@ -15,6 +15,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include +#include +#include + #include #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 @@ -/* $OpenBSD: bn_test.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_test.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -81,19 +81,9 @@ #include #include -#include #include -int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); -int BN_mod_exp_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); -int BN_mod_exp_mont_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); -int BN_mod_exp_mont_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); - -int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); +#include "bn_local.h" const int num0 = 100; /* number of tests */ const 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 @@ -/* $OpenBSD: bn_to_string.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_to_string.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* * Copyright (c) 2019 Theo Buehler * @@ -17,6 +17,7 @@ #include #include +#include #include #include 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 @@ -/* $OpenBSD: bn_unit.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ +/* $OpenBSD: bn_unit.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler @@ -18,6 +18,7 @@ #include #include +#include #include #include -- cgit v1.2.3-55-g6feb