diff options
author | tb <> | 2022-12-01 20:50:10 +0000 |
---|---|---|
committer | tb <> | 2022-12-01 20:50:10 +0000 |
commit | 1ee4f78484654f244b792d02de8a59790eaa8d57 (patch) | |
tree | 9c919d8b5975d41dccaa87e47c91d601f9dd9857 /src | |
parent | 27a426a371fafd6a5de905f5335425a4f20844fb (diff) | |
download | openbsd-1ee4f78484654f244b792d02de8a59790eaa8d57.tar.gz openbsd-1ee4f78484654f244b792d02de8a59790eaa8d57.tar.bz2 openbsd-1ee4f78484654f244b792d02de8a59790eaa8d57.zip |
Flatten structure of libcrypto/bn tests
The bn tests were distributed into three subdirectories rather randomly.
It's cleaner and easier to maintain if all this is in a single directory.
Use consistent names for the .c files, unify handling of the tests with
the exception of bn_test, which is special.
Discussed with jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/Makefile | 66 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/addsub/Makefile | 11 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_add_sub.c (renamed from src/regress/lib/libcrypto/bn/addsub/bnaddsub.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_isqrt.c (renamed from src/regress/lib/libcrypto/bn/general/bn_isqrt.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_mod_exp2_mont.c (renamed from src/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_mod_sqrt.c (renamed from src/regress/lib/libcrypto/bn/general/bn_mod_sqrt.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_mont.c (renamed from src/regress/lib/libcrypto/bn/mont/mont.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_primes.c (renamed from src/regress/lib/libcrypto/bn/general/bn_primes.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_rand_interval.c (renamed from src/regress/lib/libcrypto/bn/rand/bn_rand_interval.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_test.c (renamed from src/regress/lib/libcrypto/bn/general/bntest.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_to_string.c (renamed from src/regress/lib/libcrypto/bn/general/bn_to_string.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_unit.c (renamed from src/regress/lib/libcrypto/bn/general/bn_unit.c) | 2 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/general/Makefile | 61 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/mont/Makefile | 9 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/bn/rand/Makefile | 11 |
15 files changed, 62 insertions, 116 deletions
diff --git a/src/regress/lib/libcrypto/bn/Makefile b/src/regress/lib/libcrypto/bn/Makefile index 89c8d7861a..971ace1c77 100644 --- a/src/regress/lib/libcrypto/bn/Makefile +++ b/src/regress/lib/libcrypto/bn/Makefile | |||
@@ -1,20 +1,58 @@ | |||
1 | # $OpenBSD: Makefile,v 1.7 2022/11/30 02:51:05 jsing Exp $ | 1 | # $OpenBSD: Makefile,v 1.8 2022/12/01 20:50:10 tb Exp $ |
2 | 2 | ||
3 | SUBDIR= \ | 3 | PROGS += bn_add_sub |
4 | addsub \ | 4 | PROGS += bn_cmp |
5 | general \ | 5 | PROGS += bn_isqrt |
6 | mont \ | 6 | PROGS += bn_mod_exp2_mont |
7 | rand | 7 | PROGS += bn_mod_sqrt |
8 | PROGS += bn_mont | ||
9 | PROGS += bn_primes | ||
10 | PROGS += bn_rand_interval | ||
11 | PROGS += bn_to_string | ||
12 | PROGS += bn_unit | ||
8 | 13 | ||
9 | PROGS+= bn_cmp | 14 | STATIC_LINK += bn_isqrt |
15 | STATIC_LINK += bn_primes | ||
16 | STATIC_LINK += bn_to_string | ||
17 | STATIC_LINK += bn_rand_interval | ||
10 | 18 | ||
11 | LDADD= -lcrypto | 19 | LDADD = -lcrypto |
12 | DPADD= ${LIBCRYPTO} | 20 | DPADD = ${LIBCRYPTO} |
13 | WARNINGS= Yes | 21 | WARNINGS = Yes |
14 | CFLAGS+= -Wall -Wundef -Werror | 22 | CFLAGS += -Wall -Wundef -Werror |
23 | CFLAGS += -I${.CURDIR}/../../../../lib/libcrypto/bn/ | ||
15 | 24 | ||
16 | REGRESS_TARGETS += run-bn_cmp | 25 | .for p in ${PROGS} |
17 | run-bn_cmp: bn_cmp | 26 | REGRESS_TARGETS += run-$p |
18 | ./bn_cmp | 27 | .PHONY += run-$p |
28 | |||
29 | run-$p: $p | ||
30 | ./$p | ||
31 | .endfor | ||
32 | |||
33 | isqrt-print-tables: bn_isqrt | ||
34 | @./bn_isqrt -C | ||
35 | |||
36 | # Keep bn_test last since it is special | ||
37 | PROGS += bn_test | ||
38 | STATIC_LINK += bn_test | ||
39 | CLEANFILES += bn_test.out bc.out | ||
40 | |||
41 | REGRESS_TARGETS += run-bn_test | ||
42 | .PHONY: run-bn_test | ||
43 | run-bn_test bntest.out: bn_test | ||
44 | ./bn_test -out bn_test.out | ||
45 | |||
46 | REGRESS_TARGETS += run-bc | ||
47 | .PHONY: run-bc | ||
48 | run-bc: bn_test.out | ||
49 | bc < $> | tee bc.out | grep -v '^0$$' | ||
50 | ! grep -v '^test ' <bc.out | grep -v '^0$$' | ||
51 | |||
52 | .for p in ${STATIC_LINK} | ||
53 | LDADD_$p += ${CRYPTO_INT} | ||
54 | .endfor | ||
55 | |||
56 | .PHONY: isqrt-print-tables | ||
19 | 57 | ||
20 | .include <bsd.regress.mk> | 58 | .include <bsd.regress.mk> |
diff --git a/src/regress/lib/libcrypto/bn/addsub/Makefile b/src/regress/lib/libcrypto/bn/addsub/Makefile deleted file mode 100644 index 382e776716..0000000000 --- a/src/regress/lib/libcrypto/bn/addsub/Makefile +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | # $OpenBSD: Makefile,v 1.2 2022/06/19 17:08:19 tb Exp $ | ||
2 | |||
3 | .include "../../Makefile.inc" | ||
4 | |||
5 | PROG= bnaddsub | ||
6 | LDADD= ${LIBCRYPTO} | ||
7 | DPADD= ${LIBCRYPTO} | ||
8 | WARNINGS= Yes | ||
9 | CFLAGS+= -Werror | ||
10 | |||
11 | .include <bsd.regress.mk> | ||
diff --git a/src/regress/lib/libcrypto/bn/addsub/bnaddsub.c b/src/regress/lib/libcrypto/bn/bn_add_sub.c index e23821ed2b..f13129a000 100644 --- a/src/regress/lib/libcrypto/bn/addsub/bnaddsub.c +++ b/src/regress/lib/libcrypto/bn/bn_add_sub.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bnaddsub.c,v 1.3 2018/07/23 17:15:21 tb Exp $ */ | 1 | /* $OpenBSD: bn_add_sub.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/general/bn_isqrt.c b/src/regress/lib/libcrypto/bn/bn_isqrt.c index b0ec80b939..a730322082 100644 --- a/src/regress/lib/libcrypto/bn/general/bn_isqrt.c +++ b/src/regress/lib/libcrypto/bn/bn_isqrt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_isqrt.c,v 1.9 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: bn_isqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c b/src/regress/lib/libcrypto/bn/bn_mod_exp2_mont.c index f0ebfcbac1..0fa2b960df 100644 --- a/src/regress/lib/libcrypto/bn/general/bn_mod_exp2_mont.c +++ b/src/regress/lib/libcrypto/bn/bn_mod_exp2_mont.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_mod_exp2_mont.c,v 1.2 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: bn_mod_exp2_mont.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/general/bn_mod_sqrt.c b/src/regress/lib/libcrypto/bn/bn_mod_sqrt.c index 71e27a36e1..e193755b74 100644 --- a/src/regress/lib/libcrypto/bn/general/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.2 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: bn_mod_sqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/mont/mont.c b/src/regress/lib/libcrypto/bn/bn_mont.c index 8b9b14a20e..d7c8f9581d 100644 --- a/src/regress/lib/libcrypto/bn/mont/mont.c +++ b/src/regress/lib/libcrypto/bn/bn_mont.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mont.c,v 1.6 2022/01/14 09:32:27 tb Exp $ */ | 1 | /* $OpenBSD: bn_mont.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2014 Miodrag Vallat. | 4 | * Copyright (c) 2014 Miodrag Vallat. |
diff --git a/src/regress/lib/libcrypto/bn/general/bn_primes.c b/src/regress/lib/libcrypto/bn/bn_primes.c index e637932ccc..e9a91ba87a 100644 --- a/src/regress/lib/libcrypto/bn/general/bn_primes.c +++ b/src/regress/lib/libcrypto/bn/bn_primes.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_primes.c,v 1.4 2022/12/01 14:32:06 tb Exp $ */ | 1 | /* $OpenBSD: bn_primes.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/rand/bn_rand_interval.c b/src/regress/lib/libcrypto/bn/bn_rand_interval.c index 8cd552734c..032edfb497 100644 --- a/src/regress/lib/libcrypto/bn/rand/bn_rand_interval.c +++ b/src/regress/lib/libcrypto/bn/bn_rand_interval.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_rand_interval.c,v 1.6 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: bn_rand_interval.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/general/bntest.c b/src/regress/lib/libcrypto/bn/bn_test.c index b9581a0cd9..c1feddeda1 100644 --- a/src/regress/lib/libcrypto/bn/general/bntest.c +++ b/src/regress/lib/libcrypto/bn/bn_test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bntest.c,v 1.25 2022/09/05 21:06:31 tb Exp $ */ | 1 | /* $OpenBSD: bn_test.c,v 1.1 2022/12/01 20:50:10 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 | * |
diff --git a/src/regress/lib/libcrypto/bn/general/bn_to_string.c b/src/regress/lib/libcrypto/bn/bn_to_string.c index 901fa98610..ca5ca2f08d 100644 --- a/src/regress/lib/libcrypto/bn/general/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.2 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: bn_to_string.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
diff --git a/src/regress/lib/libcrypto/bn/general/bn_unit.c b/src/regress/lib/libcrypto/bn/bn_unit.c index f2b3652f88..b4e4a776de 100644 --- a/src/regress/lib/libcrypto/bn/general/bn_unit.c +++ b/src/regress/lib/libcrypto/bn/bn_unit.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_unit.c,v 1.6 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: bn_unit.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
diff --git a/src/regress/lib/libcrypto/bn/general/Makefile b/src/regress/lib/libcrypto/bn/general/Makefile deleted file mode 100644 index 22f3e3f95f..0000000000 --- a/src/regress/lib/libcrypto/bn/general/Makefile +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | # $OpenBSD: Makefile,v 1.16 2022/11/22 08:56:33 tb Exp $ | ||
2 | |||
3 | .include "../../Makefile.inc" | ||
4 | |||
5 | PROGS += bntest | ||
6 | PROGS += bn_isqrt | ||
7 | PROGS += bn_mod_exp2_mont | ||
8 | PROGS += bn_mod_sqrt | ||
9 | PROGS += bn_primes | ||
10 | PROGS += bn_to_string | ||
11 | PROGS += bn_unit | ||
12 | |||
13 | DPADD += ${LIBCRYPTO} | ||
14 | LDFLAGS += -lcrypto | ||
15 | WARNINGS = Yes | ||
16 | CFLAGS += -Werror | ||
17 | CFLAGS += -I${.CURDIR}/../../../../../lib/libcrypto/bn/ | ||
18 | CLEANFILES = bntest.out bc.out | ||
19 | |||
20 | LDADD_bntest = ${CRYPTO_INT} | ||
21 | REGRESS_TARGETS += run-bntest | ||
22 | run-bntest bntest.out: bntest | ||
23 | ./bntest -out bntest.out | ||
24 | |||
25 | REGRESS_TARGETS += run-bc | ||
26 | run-bc: bntest.out | ||
27 | bc < bntest.out | tee bc.out | grep -v '^0$$' | ||
28 | ! grep -v '^test ' <bc.out | grep -v '^0$$' | ||
29 | |||
30 | REGRESS_TARGETS += run-bn_mod_exp2_mont | ||
31 | run-bn_mod_exp2_mont: bn_mod_exp2_mont | ||
32 | ./bn_mod_exp2_mont | ||
33 | |||
34 | REGRESS_TARGETS += run-bn_mod_sqrt | ||
35 | run-bn_mod_sqrt: bn_mod_sqrt | ||
36 | ./bn_mod_sqrt | ||
37 | |||
38 | LDADD_bn_primes = ${CRYPTO_INT} | ||
39 | REGRESS_TARGETS += run-bn_primes | ||
40 | run-bn_primes: bn_primes | ||
41 | ./bn_primes | ||
42 | |||
43 | LDADD_bn_to_string = ${CRYPTO_INT} | ||
44 | REGRESS_TARGETS += run-bn_to_string | ||
45 | run-bn_to_string: bn_to_string | ||
46 | ./bn_to_string | ||
47 | |||
48 | REGRESS_TARGETS += run-bn_unit | ||
49 | run-bn_unit: bn_unit | ||
50 | ./bn_unit | ||
51 | |||
52 | |||
53 | LDADD_bn_isqrt = ${CRYPTO_INT} | ||
54 | REGRESS_TARGETS += run-bn_isqrt | ||
55 | run-bn_isqrt: bn_isqrt | ||
56 | ./bn_isqrt | ||
57 | |||
58 | print-tables: bn_isqrt | ||
59 | @./bn_isqrt -C | ||
60 | |||
61 | .include <bsd.regress.mk> | ||
diff --git a/src/regress/lib/libcrypto/bn/mont/Makefile b/src/regress/lib/libcrypto/bn/mont/Makefile deleted file mode 100644 index 55c48220d4..0000000000 --- a/src/regress/lib/libcrypto/bn/mont/Makefile +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | # $OpenBSD: Makefile,v 1.3 2017/01/21 09:38:58 beck Exp $ | ||
2 | |||
3 | PROG= mont | ||
4 | LDADD= -lcrypto | ||
5 | DPADD= ${LIBCRYPTO} | ||
6 | WARNINGS= Yes | ||
7 | CFLAGS+= -Werror | ||
8 | |||
9 | .include <bsd.regress.mk> | ||
diff --git a/src/regress/lib/libcrypto/bn/rand/Makefile b/src/regress/lib/libcrypto/bn/rand/Makefile deleted file mode 100644 index 52d0835df4..0000000000 --- a/src/regress/lib/libcrypto/bn/rand/Makefile +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | # $OpenBSD: Makefile,v 1.1 2018/11/06 06:55:27 tb Exp $ | ||
2 | |||
3 | .include "../../Makefile.inc" | ||
4 | |||
5 | PROG= bn_rand_interval | ||
6 | LDADD= ${CRYPTO_INT} | ||
7 | DPADD= ${LIBCRYPTO} | ||
8 | WARNINGS= Yes | ||
9 | CFLAGS+= -Werror | ||
10 | |||
11 | .include <bsd.regress.mk> | ||