main.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* main.c
  2. *
  3. * Copyright (C) 2006-2013 wolfSSL Inc.
  4. *
  5. * This file is part of CyaSSL.
  6. *
  7. * CyaSSL 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. * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. */
  21. #define PIC32_STARTER_KIT
  22. #include <p32xxxx.h>
  23. #include <plib.h>
  24. #include <sys/appio.h>
  25. void bench_des(void);
  26. void bench_arc4(void);
  27. void bench_hc128(void);
  28. void bench_rabbit(void);
  29. void bench_aes(int);
  30. void bench_aesgcm(void);
  31. void bench_md5(void);
  32. void bench_sha(void);
  33. void bench_sha256(void);
  34. void bench_sha512(void);
  35. void bench_ripemd(void);
  36. void bench_rsa(void);
  37. void bench_rsaKeyGen(void);
  38. void bench_dh(void);
  39. #ifdef HAVE_ECC
  40. void bench_eccKeyGen(void);
  41. void bench_eccKeyAgree(void);
  42. #endif
  43. /*
  44. * Main driver for CTaoCrypt benchmarks.
  45. */
  46. int main(int argc, char** argv) {
  47. SYSTEMConfigPerformance(80000000);
  48. DBINIT();
  49. printf("CTaoCrypt Benchmark:\n");
  50. #ifndef NO_AES
  51. bench_aes(0);
  52. bench_aes(1);
  53. #endif
  54. #ifdef HAVE_AESGCM
  55. bench_aesgcm();
  56. #endif
  57. #ifndef NO_RC4
  58. bench_arc4();
  59. #endif
  60. #ifdef HAVE_HC128
  61. bench_hc128();
  62. #endif
  63. #ifndef NO_RABBIT
  64. bench_rabbit();
  65. #endif
  66. #ifndef NO_DES3
  67. bench_des();
  68. #endif
  69. printf("\n");
  70. #ifndef NO_MD5
  71. bench_md5();
  72. #endif
  73. bench_sha();
  74. #ifndef NO_SHA256
  75. bench_sha256();
  76. #endif
  77. #ifdef CYASSL_SHA512
  78. bench_sha512();
  79. #endif
  80. #ifdef CYASSL_RIPEMD
  81. bench_ripemd();
  82. #endif
  83. printf("\n");
  84. #ifndef NO_RSA
  85. bench_rsa();
  86. #endif
  87. #ifndef NO_DH
  88. bench_dh();
  89. #endif
  90. #if defined(CYASSL_KEY_GEN) && !defined(NO_RSA)
  91. bench_rsaKeyGen();
  92. #endif
  93. #ifdef HAVE_ECC
  94. bench_eccKeyGen();
  95. bench_eccKeyAgree();
  96. #endif
  97. return 0;
  98. }