1
0

benchmark.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /* wolfcrypt/benchmark/benchmark.h
  2. *
  3. * Copyright (C) 2006-2024 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. #ifndef WOLFCRYPT_BENCHMARK_H
  22. #define WOLFCRYPT_BENCHMARK_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <wolfssl/wolfcrypt/types.h> /* Needed for 'byte' typedef */
  27. /* run all benchmark entry */
  28. #ifdef HAVE_STACK_SIZE
  29. THREAD_RETURN WOLFSSL_THREAD benchmark_test(void* args);
  30. #else
  31. int benchmark_test(void *args);
  32. #endif
  33. #ifndef NO_MAIN_DRIVER
  34. int wolfcrypt_benchmark_main(int argc, char** argv);
  35. #endif
  36. /* individual benchmarks */
  37. int benchmark_init(void);
  38. int benchmark_free(void);
  39. void benchmark_configure(word32 block_size);
  40. void bench_des(int useDeviceID);
  41. void bench_arc4(int useDeviceID);
  42. void bench_chacha(void);
  43. void bench_chacha20_poly1305_aead(void);
  44. void bench_aescbc(int useDeviceID);
  45. void bench_aesgcm(int useDeviceID);
  46. void bench_gmac(int useDeviceID);
  47. void bench_aesccm(int useDeviceID);
  48. void bench_aesecb(int useDeviceID);
  49. void bench_aesxts(void);
  50. void bench_aesctr(int useDeviceID);
  51. void bench_aescfb(void);
  52. void bench_aesofb(void);
  53. void bench_aessiv(void);
  54. void bench_poly1305(void);
  55. void bench_camellia(void);
  56. void bench_sm4_cbc(void);
  57. void bench_sm4_gcm(void);
  58. void bench_sm4_ccm(void);
  59. void bench_md5(int useDeviceID);
  60. void bench_sha(int useDeviceID);
  61. void bench_sha224(int useDeviceID);
  62. void bench_sha256(int useDeviceID);
  63. void bench_sha384(int useDeviceID);
  64. void bench_sha512(int useDeviceID);
  65. #if !defined(WOLFSSL_NOSHA512_224) && \
  66. (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
  67. void bench_sha512_224(int useDeviceID);
  68. #endif
  69. #if !defined(WOLFSSL_NOSHA512_256) && \
  70. (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
  71. void bench_sha512_256(int useDeviceID);
  72. #endif
  73. void bench_sha3_224(int useDeviceID);
  74. void bench_sha3_256(int useDeviceID);
  75. void bench_sha3_384(int useDeviceID);
  76. void bench_sha3_512(int useDeviceID);
  77. void bench_shake128(int useDeviceID);
  78. void bench_shake256(int useDeviceID);
  79. void bench_sm3(int useDeviceID);
  80. void bench_ripemd(void);
  81. void bench_cmac(int useDeviceID);
  82. void bench_scrypt(void);
  83. void bench_hmac_md5(int useDeviceID);
  84. void bench_hmac_sha(int useDeviceID);
  85. void bench_hmac_sha224(int useDeviceID);
  86. void bench_hmac_sha256(int useDeviceID);
  87. void bench_hmac_sha384(int useDeviceID);
  88. void bench_hmac_sha512(int useDeviceID);
  89. void bench_siphash(void);
  90. void bench_srtpkdf(void);
  91. void bench_rsaKeyGen(int useDeviceID);
  92. void bench_rsaKeyGen_size(int useDeviceID, word32 keySz);
  93. void bench_rsa(int useDeviceID);
  94. void bench_rsa_key(int useDeviceID, word32 keySz);
  95. void bench_dh(int useDeviceID);
  96. void bench_kyber(int type);
  97. void bench_lms(void);
  98. void bench_xmss(int hash);
  99. void bench_ecc_curve(int curveId);
  100. void bench_eccMakeKey(int useDeviceID, int curveId);
  101. void bench_ecc(int useDeviceID, int curveId);
  102. void bench_eccEncrypt(int curveId);
  103. void bench_sm2(int useDeviceID);
  104. void bench_curve25519KeyGen(int useDeviceID);
  105. void bench_curve25519KeyAgree(int useDeviceID);
  106. void bench_ed25519KeyGen(void);
  107. void bench_ed25519KeySign(void);
  108. void bench_curve448KeyGen(void);
  109. void bench_curve448KeyAgree(void);
  110. void bench_ed448KeyGen(void);
  111. void bench_ed448KeySign(void);
  112. void bench_eccsiKeyGen(void);
  113. void bench_eccsiPairGen(void);
  114. void bench_eccsiValidate(void);
  115. void bench_eccsi(void);
  116. void bench_sakkeKeyGen(void);
  117. void bench_sakkeRskGen(void);
  118. void bench_sakkeValidate(void);
  119. void bench_sakke(void);
  120. void bench_rng(void);
  121. void bench_blake2b(void);
  122. void bench_blake2s(void);
  123. void bench_pbkdf2(void);
  124. void bench_falconKeySign(byte level);
  125. void bench_dilithiumKeySign(byte level);
  126. void bench_sphincsKeySign(byte level, byte optim);
  127. void bench_stats_print(void);
  128. #ifdef __cplusplus
  129. } /* extern "C" */
  130. #endif
  131. #endif /* WOLFCRYPT_BENCHMARK_H */