cipher_hash_test.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /* test the ciphers and hashes using their built-in self-tests */
  10. #include <tomcrypt_test.h>
  11. int cipher_hash_test(void)
  12. {
  13. int x;
  14. /* test ciphers */
  15. for (x = 0; cipher_descriptor[x].name != NULL; x++) {
  16. DOX(cipher_descriptor[x].test(), cipher_descriptor[x].name);
  17. }
  18. /* stream ciphers */
  19. #ifdef LTC_CHACHA
  20. DO(chacha_test());
  21. #endif
  22. #ifdef LTC_RC4_STREAM
  23. DO(rc4_stream_test());
  24. #endif
  25. #ifdef LTC_SOBER128_STREAM
  26. DO(sober128_stream_test());
  27. #endif
  28. /* test hashes */
  29. for (x = 0; hash_descriptor[x].name != NULL; x++) {
  30. DOX(hash_descriptor[x].test(), hash_descriptor[x].name);
  31. }
  32. /* SHAKE128 + SHAKE256 tests are a bit special */
  33. DOX(sha3_shake_test(), "sha3_shake");
  34. return 0;
  35. }
  36. /* ref: $Format:%D$ */
  37. /* git commit: $Format:%H$ */
  38. /* commit time: $Format:%ai$ */