test_main.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* test_main.c
  2. *
  3. * Copyright (C) 2006-2017 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. #ifdef HAVE_CONFIG_H
  22. #include <config.h>
  23. #endif
  24. #include <wolfssl/wolfcrypt/settings.h>
  25. #include <wolfcrypt/test/test.h>
  26. #include <stdio.h>
  27. typedef struct func_args {
  28. int argc;
  29. char** argv;
  30. int return_code;
  31. } func_args;
  32. static func_args args = { 0 } ;
  33. void main(void)
  34. {
  35. int test_num = 0;
  36. do
  37. {
  38. printf("\nCrypt Test %d:\n", test_num);
  39. wolfcrypt_test(&args);
  40. printf("Crypt Test %d: Return code %d\n", test_num, args.return_code);
  41. test_num++;
  42. } while(args.return_code == 0);
  43. }
  44. /* SAMPLE OUTPUT:
  45. Crypt Test 0:
  46. SHA test passed!
  47. SHA-256 test passed!
  48. SHA-384 test passed!
  49. SHA-512 test passed!
  50. HMAC-SHA test passed!
  51. HMAC-SHA256 test passed!
  52. HMAC-SHA384 test passed!
  53. HMAC-SHA512 test passed!
  54. GMAC test passed!
  55. Chacha test passed!
  56. POLY1305 test passed!
  57. ChaCha20-Poly1305 AEAD test passed!
  58. AES test passed!
  59. AES-GCM test passed!
  60. AES-CCM test passed!
  61. RANDOM test passed!
  62. RSA test passed!
  63. ECC test passed!
  64. CURVE25519 test passed!
  65. ED25519 test passed!
  66. Crypt Test 0: Return code 0
  67. */