tomcrypt_test.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __TEST_H_
  2. #define __TEST_H_
  3. #include <tomcrypt.h>
  4. /* enable stack testing */
  5. /* #define STACK_TEST */
  6. /* stack testing, define this if stack usage goes downwards [e.g. x86] */
  7. #define STACK_DOWN
  8. typedef struct {
  9. char *name, *prov, *req;
  10. int (*entry)(void);
  11. } test_entry;
  12. extern prng_state yarrow_prng;
  13. void run_cmd(int res, int line, char *file, char *cmd);
  14. #define DO(x) { run_cmd((x), __LINE__, __FILE__, #x); }
  15. /* TESTS */
  16. int cipher_hash_test(void);
  17. int modes_test(void);
  18. int mac_test(void);
  19. int pkcs_1_test(void);
  20. int store_test(void);
  21. int rsa_test(void);
  22. int katja_test(void);
  23. int ecc_tests(void);
  24. int dsa_test(void);
  25. int der_tests(void);
  26. /* timing */
  27. #define KTIMES 25
  28. #define TIMES 100000
  29. extern struct list {
  30. int id;
  31. unsigned long spd1, spd2, avg;
  32. } results[];
  33. extern int no_results;
  34. int sorter(const void *a, const void *b);
  35. void tally_results(int type);
  36. ulong64 rdtsc (void);
  37. void t_start(void);
  38. ulong64 t_read(void);
  39. void init_timer(void);
  40. /* register default algs */
  41. void reg_algs(void);
  42. int time_keysched(void);
  43. int time_cipher(void);
  44. int time_cipher2(void);
  45. int time_cipher3(void);
  46. int time_hash(void);
  47. void time_mult(void);
  48. void time_sqr(void);
  49. void time_prng(void);
  50. void time_rsa(void);
  51. void time_katja(void);
  52. void time_ecc(void);
  53. void time_macs_(unsigned long MAC_SIZE);
  54. void time_macs(void);
  55. void time_encmacs(void);
  56. #endif
  57. /* $Source$ */
  58. /* $Revision$ */
  59. /* $Date$ */