Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing algorithms to benchmark #2056

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tool/speed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,8 @@ static bool SpeedHashChunk(const EVP_MD *md, std::string name,

return EVP_DigestInit_ex(ctx.get(), md, NULL /* ENGINE */) &&
EVP_DigestUpdate(ctx.get(), input.get(), chunk_len) &&
EVP_DigestFinal_ex(ctx.get(), digest, &md_len);
(EVP_MD_flags(ctx->digest) & EVP_MD_FLAG_XOF) ?
EVP_DigestFinalXOF(ctx.get(), digest, 32) : EVP_DigestFinal_ex(ctx.get(), digest, &md_len);
})) {
fprintf(stderr, "EVP_DigestInit_ex failed.\n");
ERR_print_errors_fp(stderr);
Expand Down Expand Up @@ -2808,11 +2809,14 @@ bool Speed(const std::vector<std::string> &args) {
!SpeedEvpCipherGeneric(EVP_aes_192_ctr(), "EVP-AES-192-CTR", kTLSADLen, selected) ||
!SpeedEvpCipherGeneric(EVP_aes_256_ctr(), "EVP-AES-256-CTR", kTLSADLen, selected) ||
!SpeedAES256XTS("AES-256-XTS", selected) ||
!SpeedEvpCipherGeneric(EVP_rc4(), "EVP-RC4", kTLSADLen, selected) ||
// OpenSSL 3.0 doesn't allow MD4 calls
#if !defined(OPENSSL_3_0_BENCHMARK)
!SpeedHash(EVP_md4(), "MD4", selected) ||
#endif
!SpeedHash(EVP_md5(), "MD5", selected) ||
!SpeedHash(EVP_md5_sha1(), "MD5-SHA-1", selected) ||
!SpeedHash(EVP_ripemd160(), "RIPEMD-160", selected) ||
!SpeedHash(EVP_sha1(), "SHA-1", selected) ||
!SpeedHash(EVP_sha224(), "SHA-224", selected) ||
!SpeedHash(EVP_sha256(), "SHA-256", selected) ||
Expand All @@ -2824,6 +2828,8 @@ bool Speed(const std::vector<std::string> &args) {
!SpeedHash(EVP_sha3_256(), "SHA3-256", selected) ||
!SpeedHash(EVP_sha3_384(), "SHA3-384", selected) ||
!SpeedHash(EVP_sha3_512(), "SHA3-512", selected) ||
!SpeedHash(EVP_shake128(), "SHAKE-128", selected) ||
!SpeedHash(EVP_shake256(), "SHAKE-256", selected) ||
#endif
!SpeedHmac(EVP_md5(), "HMAC-MD5", selected) ||
!SpeedHmac(EVP_sha1(), "HMAC-SHA1", selected) ||
Expand Down
Loading