comparison testprof/tomcrypt_test.h @ 191:1c15b283127b libtomcrypt-orig

Import of libtomcrypt 1.02 with manual path rename rearrangement etc
author Matt Johnston <matt@ucc.asn.au>
date Fri, 06 May 2005 13:23:02 +0000
parents
children 39d5d58461d6
comparison
equal deleted inserted replaced
143:5d99163f7e32 191:1c15b283127b
1
2 #ifndef __TEST_H_
3 #define __TEST_H_
4
5 #include <tomcrypt.h>
6
7 /* enable stack testing */
8 // #define STACK_TEST
9
10 /* stack testing, define this if stack usage goes downwards [e.g. x86] */
11 #define STACK_DOWN
12
13 typedef struct {
14 char *name, *prov, *req;
15 int (*entry)(void);
16 } test_entry;
17
18 extern prng_state yarrow_prng;
19
20 void run_cmd(int res, int line, char *file, char *cmd);
21 #define DO(x) { run_cmd((x), __LINE__, __FILE__, #x); }
22
23 /* TESTS */
24 int cipher_hash_test(void);
25 int modes_test(void);
26 int mac_test(void);
27 int pkcs_1_test(void);
28 int store_test(void);
29 int rsa_test(void);
30 int ecc_tests(void);
31 int dsa_test(void);
32 int dh_tests(void);
33 int der_tests(void);
34
35 /* timing */
36 #define KTIMES 25
37 #define TIMES 100000
38
39 extern struct list {
40 int id;
41 unsigned long spd1, spd2, avg;
42 } results[];
43
44 extern int no_results;
45
46 int sorter(const void *a, const void *b);
47 void tally_results(int type);
48 ulong64 rdtsc (void);
49
50 void t_start(void);
51 ulong64 t_read(void);
52 void init_timer(void);
53
54 /* register default algs */
55 void reg_algs(void);
56 int time_keysched(void);
57 int time_cipher(void);
58 int time_cipher2(void);
59 int time_cipher3(void);
60 int time_hash(void);
61 void time_mult(void);
62 void time_sqr(void);
63 void time_prng(void);
64 void time_rsa(void);
65 void time_ecc(void);
66 void time_dh(void);
67 void time_macs_(unsigned long MAC_SIZE);
68 void time_macs(void);
69 void time_encmacs(void);
70
71
72
73 #endif