mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-27 22:12:19 +01:00
* add option to run benchmarks with and w/o AAD This adds the possibility to benchmark AES-GCM and AES-CCM both with and w/o AAD, with the option to also run both. The default behavior when wolfSSL provides the `main()` function is unchanged. The default behavior when wolfSSL doesn't provide the `main()` function has been changed to "run both benchmarks - with and w/o ADD". * add option to run benchmarks against 4096bit RSA&DH keys * remove `BENCH_SIZE` macro from benchmark.c * pre-define benchmark sizes in a single place, before it had to be done in two places * improve `benchmark_static_init()` - static variable doesn't need to be in global scope - add option to force re-init - add more static variables to be reset * add `-blocks` option to benchmarks * expose benchmark `main()` as `wolfcrypt_benchmark_main()` * fix benchmark `-?` output * use correct SI/Binary prefix in benchmarks * use a separate column per detail in CSV output of benchmark * add `-aad_size` option to benchmark * don't always print symmetric CSV headers * always use M[i]B/s when output format is CSV * Versal specific patches for benchmarks This also removes the default define for `COUNTS_PER_SECOND` for Xilinx targets, since I prefer to have a build failure over wrongly calculated output. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
132 lines
3.9 KiB
C
132 lines
3.9 KiB
C
/* wolfcrypt/benchmark/benchmark.h
|
|
*
|
|
* Copyright (C) 2006-2022 wolfSSL Inc.
|
|
*
|
|
* This file is part of wolfSSL.
|
|
*
|
|
* wolfSSL is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* wolfSSL is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
|
*/
|
|
|
|
|
|
#ifndef WOLFCRYPT_BENCHMARK_H
|
|
#define WOLFCRYPT_BENCHMARK_H
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <wolfssl/wolfcrypt/types.h> /* Needed for 'byte' typedef */
|
|
|
|
/* run all benchmark entry */
|
|
#ifdef HAVE_STACK_SIZE
|
|
THREAD_RETURN WOLFSSL_THREAD benchmark_test(void* args);
|
|
#else
|
|
int benchmark_test(void *args);
|
|
#endif
|
|
#ifndef NO_MAIN_DRIVER
|
|
int wolfcrypt_benchmark_main(int argc, char** argv);
|
|
#endif
|
|
|
|
/* individual benchmarks */
|
|
int benchmark_init(void);
|
|
int benchmark_free(void);
|
|
void benchmark_configure(int block_size);
|
|
|
|
void bench_des(int useDeviceID);
|
|
void bench_arc4(int useDeviceID);
|
|
void bench_chacha(void);
|
|
void bench_chacha20_poly1305_aead(void);
|
|
void bench_aescbc(int useDeviceID);
|
|
void bench_aesgcm(int useDeviceID);
|
|
void bench_gmac(void);
|
|
void bench_aesccm(int dummy);
|
|
void bench_aesecb(int useDeviceID);
|
|
void bench_aesxts(void);
|
|
void bench_aesctr(void);
|
|
void bench_aescfb(void);
|
|
void bench_aesofb(void);
|
|
void bench_aessiv(void);
|
|
void bench_poly1305(void);
|
|
void bench_camellia(void);
|
|
void bench_md5(int useDeviceID);
|
|
void bench_sha(int useDeviceID);
|
|
void bench_sha224(int useDeviceID);
|
|
void bench_sha256(int useDeviceID);
|
|
void bench_sha384(int useDeviceID);
|
|
void bench_sha512(int useDeviceID);
|
|
void bench_sha3_224(int useDeviceID);
|
|
void bench_sha3_256(int useDeviceID);
|
|
void bench_sha3_384(int useDeviceID);
|
|
void bench_sha3_512(int useDeviceID);
|
|
void bench_shake128(int useDeviceID);
|
|
void bench_shake256(int useDeviceID);
|
|
int bench_ripemd(void);
|
|
void bench_cmac(void);
|
|
void bench_scrypt(void);
|
|
void bench_hmac_md5(int useDeviceID);
|
|
void bench_hmac_sha(int useDeviceID);
|
|
void bench_hmac_sha224(int useDeviceID);
|
|
void bench_hmac_sha256(int useDeviceID);
|
|
void bench_hmac_sha384(int useDeviceID);
|
|
void bench_hmac_sha512(int useDeviceID);
|
|
void bench_siphash(void);
|
|
void bench_rsaKeyGen(int useDeviceID);
|
|
void bench_rsaKeyGen_size(int useDeviceID, int keySz);
|
|
void bench_rsa(int useDeviceID);
|
|
void bench_rsa_key(int useDeviceID, int keySz);
|
|
void bench_dh(int useDeviceID);
|
|
void bench_kyber(int type);
|
|
void bench_ecc_curve(int curveId);
|
|
void bench_eccMakeKey(int useDeviceID, int curveId);
|
|
void bench_ecc(int useDeviceID, int curveId);
|
|
void bench_eccEncrypt(int curveId);
|
|
void bench_curve25519KeyGen(void);
|
|
void bench_curve25519KeyAgree(void);
|
|
void bench_ed25519KeyGen(void);
|
|
void bench_ed25519KeySign(void);
|
|
void bench_curve448KeyGen(void);
|
|
void bench_curve448KeyAgree(void);
|
|
void bench_ed448KeyGen(void);
|
|
void bench_ed448KeySign(void);
|
|
void bench_eccsiKeyGen(void);
|
|
void bench_eccsiPairGen(void);
|
|
void bench_eccsiValidate(void);
|
|
void bench_eccsi(void);
|
|
void bench_sakkeKeyGen(void);
|
|
void bench_sakkeRskGen(void);
|
|
void bench_sakkeValidate(void);
|
|
void bench_sakke(void);
|
|
void bench_rng(void);
|
|
void bench_blake2b(void);
|
|
void bench_blake2s(void);
|
|
void bench_pbkdf2(void);
|
|
void bench_falconKeySign(byte level);
|
|
void bench_dilithiumKeySign(byte level, byte sym);
|
|
void bench_sphincsKeySign(byte level, byte optim);
|
|
void bench_pqcKemKeygen(word32 alg);
|
|
void bench_pqcKemEncapDecap(word32 alg);
|
|
|
|
void bench_stats_print(void);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern "C" */
|
|
#endif
|
|
|
|
|
|
#endif /* WOLFCRYPT_BENCHMARK_H */
|
|
|