rename 'testprof/' to 'tests/'

This commit is contained in:
Steffen Jaeckel 2017-06-05 15:58:10 +02:00
parent 07ffa0f1a2
commit e1a1145802
36 changed files with 57 additions and 61 deletions

View File

@ -5,7 +5,7 @@ set -e
./sizes
./constants
for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i testprof/test.key ; done > hashsum_tv.txt
for i in $(for j in $(echo $(./hashsum -h | tail -n +3)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i tests/test.key ; done > hashsum_tv.txt
difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true
if [ -n "$difftroubles" ]; then
echo "FAILURE: hashsum_tv.tx"

View File

@ -27,7 +27,7 @@ sub write_file {
sub check_source {
my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl"));
find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src testprof demos/);
find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src tests demos/);
my $fails = 0;
for my $file (sort @all_files) {
@ -96,7 +96,7 @@ sub check_descriptors {
}
my $fails = 0;
for my $d (@descriptors) {
for my $f (qw{ testprof/common.c }) {
for my $f (qw{ tests/common.c }) {
my $txt = read_file($f);
warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/;
}
@ -239,7 +239,7 @@ sub process_makefiles {
my @all = ();
find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src');
my @t = qw();
find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'testprof');
find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'tests');
my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c);
my $var_o = prepare_variable("OBJECTS", @o);

View File

@ -58,11 +58,11 @@ ifneq ($V,1)
endif
${silent} $(RANLIB) $@
timing: $(LIBNAME) $(TIMINGS) testprof/common.o
timing: $(LIBNAME) $(TIMINGS) tests/common.o
ifneq ($V,1)
@echo " * ${CC} $@"
endif
${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING)
${silent} $(CC) $(LDFLAGS) $(TIMINGS) tests/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING)
test: $(LIBNAME) $(TOBJECTS)
ifneq ($V,1)
@ -72,11 +72,11 @@ endif
# build the demos from a template
define DEMO_template
$(1): demos/$(1).o $$(LIBNAME) testprof/common.o
$(1): demos/$(1).o $$(LIBNAME) tests/common.o
ifneq ($V,1)
@echo " * $${CC} $$@"
endif
$${silent} $$(CC) $$(CFLAGS) $$< testprof/common.o $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1)
$${silent} $$(CC) $$(CFLAGS) $$< tests/common.o $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1)
endef
$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))

View File

@ -25,7 +25,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
EXTRALIBS = -L../libtommath -ltommath
#Compilation flags
LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE
LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
VERSION=1.17
@ -187,12 +187,11 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \
src/stream/sober128/sober128_test.o
#List of test objects to compile (all goes to libtomcrypt_prof.a)
TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \
testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \
testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \
testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \
testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \
testprof/store_test.o testprof/test.o
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \
tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \
tests/rsa_test.o tests/store_test.o tests/test.o
#The following headers will be installed by "make install"
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
@ -219,7 +218,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
#Dependencies on *.h
$(OBJECTS): $(HEADERS)
$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
.c.o:
$(CC) $(LTC_CFLAGS) -c $< -o $@
@ -235,18 +234,18 @@ $(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS)
$(STRIP) -S $(LIBMAIN_D)
#Demo tools/utilities
hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S)
hashsum: demos/hashsum.o tests/common.o $(LIBMAIN_S)
$(CC) $? $(LTC_LDFLAGS) -o $@
crypt: demos/crypt.o testprof/common.o $(LIBMAIN_S)
crypt: demos/crypt.o tests/common.o $(LIBMAIN_S)
$(CC) $? $(LTC_LDFLAGS) -o $@
small: demos/small.o testprof/common.o $(LIBMAIN_S)
small: demos/small.o tests/common.o $(LIBMAIN_S)
$(CC) $? $(LTC_LDFLAGS) -o $@
tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S)
tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S)
$(CC) $? $(LTC_LDFLAGS) -o $@
#Tests + timing tests
timing.exe: demos/timing.o testprof/common.o $(LIBMAIN_S)
$(CC) demos/timing.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
timing.exe: demos/timing.o tests/common.o $(LIBMAIN_S)
$(CC) demos/timing.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
@echo NOTICE: start the tests by: timing.exe
test.exe: $(TOBJECTS) $(LIBMAIN_S)
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@

View File

@ -20,7 +20,7 @@ CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath
EXTRALIBS = ../libtommath/tommath.lib
#Compilation flags
LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itestprof/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3
LTC_CFLAGS = $(CFLAGS) /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3
LTC_LDFLAGS = advapi32.lib $(EXTRALIBS)
VERSION=1.17
@ -180,12 +180,11 @@ src/stream/rc4/rc4.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128.
src/stream/sober128/sober128_test.obj
#List of test objects to compile (all goes to tomcrypt_prof.lib)
TOBJECTS=testprof/base64_test.obj testprof/cipher_hash_test.obj testprof/common.obj testprof/der_tests.obj \
testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_test.obj testprof/katja_test.obj \
testprof/mac_test.obj testprof/misc_test.obj testprof/modes_test.obj testprof/multi_test.obj testprof/no_prng.obj \
testprof/pkcs_1_eme_test.obj testprof/pkcs_1_emsa_test.obj testprof/pkcs_1_oaep_test.obj \
testprof/pkcs_1_pss_test.obj testprof/pkcs_1_test.obj testprof/rotate_test.obj testprof/rsa_test.obj \
testprof/store_test.obj testprof/test.obj
TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_tests.obj tests/dh_test.obj \
tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \
tests/modes_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj tests/pkcs_1_emsa_test.obj \
tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj tests/rotate_test.obj \
tests/rsa_test.obj tests/store_test.obj tests/test.obj
#The following headers will be installed by "make install"
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
@ -212,7 +211,7 @@ src/hashes/sha2/sha256.obj: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
#Dependencies on *.h
$(OBJECTS): $(HEADERS)
$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
.c.obj:
$(CC) $(LTC_CFLAGS) /c $< /Fo$@

View File

@ -46,12 +46,12 @@ install_bins: .common_install_bins
test: $(LIBNAME) $(TOBJECTS)
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
timing: $(TIMINGS) testprof/common.o $(LIBNAME)
timing: $(TIMINGS) tests/common.o $(LIBNAME)
$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $^ $(EXTRALIBS)
# build the demos from a template
define DEMO_template
$(1): demos/$(1).o testprof/common.o $$(LIBNAME)
$(1): demos/$(1).o tests/common.o $$(LIBNAME)
ifneq ($V,1)
@echo " * $${CC} $$@"
endif

View File

@ -32,7 +32,7 @@ CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
EXTRALIBS = ../libtommath/libtommath.a
#Compilation flags
LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itestprof -DLTC_SOURCE
LTC_CFLAGS = $(CFLAGS) -Isrc/headers -Itests -DLTC_SOURCE
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
VERSION=1.17
@ -192,12 +192,11 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \
src/stream/sober128/sober128_test.o
#List of test objects to compile (all goes to libtomcrypt_prof.a)
TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \
testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \
testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \
testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \
testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \
testprof/store_test.o testprof/test.o
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \
tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \
tests/rsa_test.o tests/store_test.o tests/test.o
#The following headers will be installed by "make install"
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
@ -224,7 +223,7 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
#Dependencies on *.h
$(OBJECTS): $(HEADERS)
$(TOBJECTS): $(HEADERS) testprof/tomcrypt_test.h
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
#This is necessary for compatibility with BSD make (namely on OpenBSD)
.SUFFIXES: .o .c
@ -237,18 +236,18 @@ $(LIBMAIN_S): $(OBJECTS)
$(RANLIB) $@
#Demo tools/utilities
hashsum: demos/hashsum.o testprof/common.o $(LIBMAIN_S)
$(CC) demos/hashsum.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
ltcrypt: demos/ltcrypt.o testprof/common.o $(LIBMAIN_S)
$(CC) demos/ltcrypt.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
small: demos/small.o testprof/common.o $(LIBMAIN_S)
$(CC) demos/small.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S)
$(CC) demos/tv_gen.o testprof/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
hashsum: demos/hashsum.o tests/common.o $(LIBMAIN_S)
$(CC) demos/hashsum.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
ltcrypt: demos/ltcrypt.o tests/common.o $(LIBMAIN_S)
$(CC) demos/ltcrypt.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
small: demos/small.o tests/common.o $(LIBMAIN_S)
$(CC) demos/small.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
tv_gen: demos/tv_gen.o tests/common.o $(LIBMAIN_S)
$(CC) demos/tv_gen.o tests/common.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
#Tests + timing tests
timing: demos/timing.o $(LIBMAIN_S) testprof/common.o
$(CC) demos/timing.o $(LIBMAIN_S) testprof/common.o $(LTC_LDFLAGS) -o $@
timing: demos/timing.o $(LIBMAIN_S) tests/common.o
$(CC) demos/timing.o $(LIBMAIN_S) tests/common.o $(LTC_LDFLAGS) -o $@
@echo "NOTICE: start the timing tests by: ./timing"
test: $(TOBJECTS) $(LIBMAIN_S)
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@

View File

@ -102,8 +102,8 @@ endif
DSOURCES = $(wildcard demos/*.c)
DOBJECTS = $(DSOURCES:.c=.o)
#List of testprof headers
THEADERS = $(wildcard testprof/*.h)
#List of tests headers
THEADERS = $(wildcard tests/*.h)
TIMING=timing
TEST=test
@ -290,12 +290,11 @@ src/stream/rc4/rc4.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128.o \
src/stream/sober128/sober128_test.o
# List of test objects to compile (all goes to libtomcrypt_prof.a)
TOBJECTS=testprof/base64_test.o testprof/cipher_hash_test.o testprof/common.o testprof/der_tests.o \
testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_test.o testprof/katja_test.o \
testprof/mac_test.o testprof/misc_test.o testprof/modes_test.o testprof/multi_test.o testprof/no_prng.o \
testprof/pkcs_1_eme_test.o testprof/pkcs_1_emsa_test.o testprof/pkcs_1_oaep_test.o \
testprof/pkcs_1_pss_test.o testprof/pkcs_1_test.o testprof/rotate_test.o testprof/rsa_test.o \
testprof/store_test.o testprof/test.o
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_tests.o tests/dh_test.o \
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
tests/modes_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o tests/pkcs_1_emsa_test.o \
tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o tests/rotate_test.o \
tests/rsa_test.o tests/store_test.o tests/test.o
# The following headers will be installed by "make install"
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
@ -317,8 +316,8 @@ src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
#The default rule for make builds the libtomcrypt library.
default:library
$(DOBJECTS): CFLAGS += -Itestprof
$(TOBJECTS): CFLAGS += -Itestprof
$(DOBJECTS): CFLAGS += -Itests
$(TOBJECTS): CFLAGS += -Itests
#This rule makes the libtomcrypt library.
library: $(LIBNAME)

View File

@ -11,7 +11,7 @@ int file_test(void)
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F };
unsigned char buf[200];
unsigned long len;
char *fname = "testprof/test.key";
char *fname = "tests/test.key";
FILE *in;
int err, isha256, iaes;