merge testprof/timing_test.c into demos/timing.c
This commit is contained in:
		
							parent
							
								
									70a27a852e
								
							
						
					
					
						commit
						201681ee3b
					
				
							
								
								
									
										1344
									
								
								demos/timing.c
									
									
									
									
									
								
							
							
						
						
									
										1344
									
								
								demos/timing.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -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|test_driver|x86_prof|_tests?).c$/ } }, 'testprof'); | ||||
|   find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?).c$/ } }, 'testprof'); | ||||
| 
 | ||||
|   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); | ||||
|  | ||||
							
								
								
									
										4
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								makefile
									
									
									
									
									
								
							| @ -71,11 +71,11 @@ ifneq ($V,1) | ||||
| endif | ||||
| 	${silent} $(RANLIB) $@ | ||||
| 
 | ||||
| timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) | ||||
| timing: $(LIBNAME) $(TIMINGS) testprof/common.o | ||||
| ifneq ($V,1) | ||||
| 	@echo "   * ${CC} $@" | ||||
| endif | ||||
| 	${silent} $(CC) $(LDFLAGS) $(TIMINGS) $(LIBTEST) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) | ||||
| 	${silent} $(CC) $(LDFLAGS) $(TIMINGS) testprof/common.o $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TIMING) | ||||
| 
 | ||||
| test: $(LIBNAME) $(LIBTEST) $(TESTS) | ||||
| ifneq ($V,1) | ||||
|  | ||||
| @ -193,7 +193,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_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/timing_test.o | ||||
| testprof/store_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 \ | ||||
| @ -251,7 +251,7 @@ tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) | ||||
| 	$(CC) $? $(LTC_LDFLAGS) -o $@ | ||||
| 
 | ||||
| #Tests + timing tests | ||||
| timing.exe: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) | ||||
| timing.exe: demos/timing.o testprof/common.o $(LIBMAIN_S) | ||||
| 	$(CC) $? $(LTC_LDFLAGS) -o $@ | ||||
| 	@echo NOTICE: start the tests by: timing.exe | ||||
| test.exe: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) | ||||
|  | ||||
| @ -186,7 +186,7 @@ testprof/dh_test.obj testprof/dsa_test.obj testprof/ecc_test.obj testprof/file_t | ||||
| 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/timing_test.obj | ||||
| testprof/store_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 \ | ||||
|  | ||||
| @ -54,8 +54,8 @@ install_test: .common_install_test | ||||
| test: $(LIBNAME) $(LIBTEST) $(TESTS) | ||||
| 	$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TEST) $(TESTS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) | ||||
| 
 | ||||
| timing: $(LIBNAME) $(LIBTEST) $(TIMINGS) | ||||
| 	$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) | ||||
| timing: $(TIMINGS) testprof/common.o $(LIBNAME) | ||||
| 	$(LT) --mode=link --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(TIMING) $? $(EXTRALIBS) | ||||
| 
 | ||||
| # build the demos from a template | ||||
| define DEMO_template | ||||
|  | ||||
| @ -198,7 +198,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_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/timing_test.o | ||||
| testprof/store_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 \ | ||||
| @ -253,7 +253,7 @@ tv_gen: demos/tv_gen.o testprof/common.o $(LIBMAIN_S) | ||||
| 	$(CC) $? $(LTC_LDFLAGS) -o $@ | ||||
| 
 | ||||
| #Tests + timing tests | ||||
| timing: demos/timing.o $(LIBTEST_S) $(LIBMAIN_S) | ||||
| timing: demos/timing.o testprof/common.o $(LIBMAIN_S) | ||||
| 	$(CC) $? $(LTC_LDFLAGS) -o $@ | ||||
| 	@echo "NOTICE: start the timing tests by: ./timing" | ||||
| test: demos/test.o $(LIBTEST_S) $(LIBMAIN_S) | ||||
|  | ||||
| @ -296,7 +296,7 @@ testprof/dh_test.o testprof/dsa_test.o testprof/ecc_test.o testprof/file_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/timing_test.o | ||||
| testprof/store_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 \
 | ||||
|  | ||||
| @ -3,6 +3,12 @@ | ||||
| 
 | ||||
| #include <tomcrypt.h> | ||||
| 
 | ||||
| #if defined(_WIN32) | ||||
|    #define PRI64  "I64d" | ||||
| #else | ||||
|    #define PRI64  "ll" | ||||
| #endif | ||||
| 
 | ||||
| extern prng_state yarrow_prng; | ||||
| 
 | ||||
| #ifdef LTC_VERBOSE | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -52,55 +52,10 @@ int base64_test(void); | ||||
| int file_test(void); | ||||
| int multi_test(void); | ||||
| 
 | ||||
| /* timing */ | ||||
| #define KTIMES  25 | ||||
| #define TIMES   100000 | ||||
| 
 | ||||
| extern struct list { | ||||
|     int id; | ||||
|     ulong64 spd1, spd2, avg; | ||||
| } results[]; | ||||
| 
 | ||||
| extern int no_results; | ||||
| 
 | ||||
| #ifdef LTC_PKCS_1 | ||||
| extern const struct ltc_prng_descriptor no_prng_desc; | ||||
| #endif | ||||
| 
 | ||||
| int sorter(const void *a, const void *b); | ||||
| void tally_results(int type); | ||||
| ulong64 rdtsc (void); | ||||
| 
 | ||||
| void t_start(void); | ||||
| ulong64 t_read(void); | ||||
| void init_timer(void); | ||||
| 
 | ||||
| /* register default algs */ | ||||
| int time_keysched(void); | ||||
| int time_cipher_ecb(void); | ||||
| int time_cipher_cbc(void); | ||||
| int time_cipher_ctr(void); | ||||
| int time_cipher_lrw(void); | ||||
| int time_hash(void); | ||||
| void time_mult(void); | ||||
| void time_sqr(void); | ||||
| void time_prng(void); | ||||
| void time_rsa(void); | ||||
| void time_dsa(void); | ||||
| void time_katja(void); | ||||
| void time_ecc(void); | ||||
| void time_macs_(unsigned long MAC_SIZE); | ||||
| void time_macs(void); | ||||
| void time_encmacs(void); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| #if defined(_WIN32) | ||||
|    #define PRI64  "I64d" | ||||
| #else | ||||
|    #define PRI64  "ll" | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
| /* $Source$ */ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user