benchmark.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* wolfcrypt/benchmark/benchmark.h
  2. *
  3. * Copyright (C) 2006-2023 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(void);
  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_md5(int useDeviceID);
  57. void bench_sha(int useDeviceID);
  58. void bench_sha224(int useDeviceID);
  59. void bench_sha256(int useDeviceID);
  60. void bench_sha384(int useDeviceID);
  61. void bench_sha512(int useDeviceID);
  62. #if !defined(WOLFSSL_NOSHA512_224) && \
  63. (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
  64. void bench_sha512_224(int useDeviceID);
  65. #endif
  66. #if !defined(WOLFSSL_NOSHA512_256) && \
  67. (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST)
  68. void bench_sha512_256(int useDeviceID);
  69. #endif
  70. void bench_sha3_224(int useDeviceID);
  71. void bench_sha3_256(int useDeviceID);
  72. void bench_sha3_384(int useDeviceID);
  73. void bench_sha3_512(int useDeviceID);
  74. void bench_shake128(int useDeviceID);
  75. void bench_shake256(int useDeviceID);
  76. void bench_ripemd(void);
  77. void bench_cmac(int useDeviceID);
  78. void bench_scrypt(void);
  79. void bench_hmac_md5(int useDeviceID);
  80. void bench_hmac_sha(int useDeviceID);
  81. void bench_hmac_sha224(int useDeviceID);
  82. void bench_hmac_sha256(int useDeviceID);
  83. void bench_hmac_sha384(int useDeviceID);
  84. void bench_hmac_sha512(int useDeviceID);
  85. void bench_siphash(void);
  86. void bench_rsaKeyGen(int useDeviceID);
  87. void bench_rsaKeyGen_size(int useDeviceID, word32 keySz);
  88. void bench_rsa(int useDeviceID);
  89. void bench_rsa_key(int useDeviceID, word32 keySz);
  90. void bench_dh(int useDeviceID);
  91. void bench_kyber(int type);
  92. void bench_ecc_curve(int curveId);
  93. void bench_eccMakeKey(int useDeviceID, int curveId);
  94. void bench_ecc(int useDeviceID, int curveId);
  95. void bench_eccEncrypt(int curveId);
  96. void bench_curve25519KeyGen(int useDeviceID);
  97. void bench_curve25519KeyAgree(int useDeviceID);
  98. void bench_ed25519KeyGen(void);
  99. void bench_ed25519KeySign(void);
  100. void bench_curve448KeyGen(void);
  101. void bench_curve448KeyAgree(void);
  102. void bench_ed448KeyGen(void);
  103. void bench_ed448KeySign(void);
  104. void bench_eccsiKeyGen(void);
  105. void bench_eccsiPairGen(void);
  106. void bench_eccsiValidate(void);
  107. void bench_eccsi(void);
  108. void bench_sakkeKeyGen(void);
  109. void bench_sakkeRskGen(void);
  110. void bench_sakkeValidate(void);
  111. void bench_sakke(void);
  112. void bench_rng(void);
  113. void bench_blake2b(void);
  114. void bench_blake2s(void);
  115. void bench_pbkdf2(void);
  116. void bench_falconKeySign(byte level);
  117. void bench_dilithiumKeySign(byte level);
  118. void bench_sphincsKeySign(byte level, byte optim);
  119. void bench_stats_print(void);
  120. #ifdef __cplusplus
  121. } /* extern "C" */
  122. #endif
  123. #endif /* WOLFCRYPT_BENCHMARK_H */