comparison libtomcrypt/testprof/tomcrypt_test.h @ 285:1b9e69c058d2

propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3) to branch 'au.asn.ucc.matt.dropbear' (head fdf4a7a3b97ae5046139915de7e40399cceb2c01)
author Matt Johnston <matt@ucc.asn.au>
date Wed, 08 Mar 2006 13:23:58 +0000
parents
children 0cbe8f6dbf9e
comparison
equal deleted inserted replaced
281:997e6f7dc01e 285:1b9e69c058d2
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
74
75 /* $Source: /cvs/libtom/libtomcrypt/testprof/tomcrypt_test.h,v $ */
76 /* $Revision: 1.8 $ */
77 /* $Date: 2005/05/05 14:35:59 $ */