tomcrypt_test.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* LibTomCrypt, modular cryptographic library -- Tom St Denis
  2. *
  3. * LibTomCrypt is a library that provides various cryptographic
  4. * algorithms in a highly modular and flexible manner.
  5. *
  6. * The library is free for all purposes without any express
  7. * guarantee it works.
  8. */
  9. #ifndef __TEST_H_
  10. #define __TEST_H_
  11. #include <tomcrypt.h>
  12. #include "common.h"
  13. #ifdef USE_LTM
  14. /* Use libtommath as MPI provider */
  15. #elif defined(USE_TFM)
  16. /* Use tomsfastmath as MPI provider */
  17. #elif defined(USE_GMP)
  18. /* Use GNU Multiple Precision Arithmetic Library as MPI provider */
  19. #else
  20. /* The user must define his own MPI provider! */
  21. #ifndef EXT_MATH_LIB
  22. /*
  23. * Yes, you're right, you could also name your instance of the MPI provider
  24. * "EXT_MATH_LIB" and you wouldn't need to define it, but most users won't do
  25. * this and so it's treated as an error and you have to comment out the
  26. * following statement :)
  27. */
  28. #error EXT_MATH_LIB is required to be defined
  29. #endif
  30. #endif
  31. typedef struct {
  32. char *name, *prov, *req;
  33. int (*entry)(void);
  34. } test_entry;
  35. /* TESTS */
  36. int cipher_hash_test(void);
  37. int modes_test(void);
  38. int mac_test(void);
  39. int pkcs_1_test(void);
  40. int pkcs_1_pss_test(void);
  41. int pkcs_1_oaep_test(void);
  42. int pkcs_1_emsa_test(void);
  43. int pkcs_1_eme_test(void);
  44. int store_test(void);
  45. int rotate_test(void);
  46. int rsa_test(void);
  47. int dh_test(void);
  48. int katja_test(void);
  49. int ecc_tests(void);
  50. int dsa_test(void);
  51. int der_test(void);
  52. int misc_test(void);
  53. int base64_test(void);
  54. int file_test(void);
  55. int multi_test(void);
  56. int prng_test(void);
  57. int mpi_test(void);
  58. #ifdef LTC_PKCS_1
  59. struct ltc_prng_descriptor* no_prng_desc_get(void);
  60. void no_prng_desc_free(struct ltc_prng_descriptor*);
  61. #endif
  62. #endif
  63. /* ref: $Format:%D$ */
  64. /* git commit: $Format:%H$ */
  65. /* commit time: $Format:%ai$ */