From: Ingo Franzki Date: Mon, 23 Jun 2025 11:42:08 +0000 (+0200) Subject: speed: Increase MAX_SIG_NUM and fix its usage in loopargs_t fields X-Git-Tag: openssl-3.4.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29e08984481cd18316cbf5ec62433a1779c78b1f;p=thirdparty%2Fopenssl.git speed: Increase MAX_SIG_NUM and fix its usage in loopargs_t fields Increase the maximum number of signature algorithms. With the introduction of the SignMessage and VerifyMessage API with OpenSSL 3.4 the providers that support combined digest and sign algorithms register quite a lot more signature algorithms, so the current limit of 111 is hit easily. While at it correct the definitions of the signature fields within the loopargs_t structure to use MAX_SIG_NUM instead of MAX_KEM_NUM. Closes: https://github.com/openssl/openssl/issues/27873 Signed-off-by: Ingo Franzki Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/27878) (cherry picked from commit 7bdc0d13d2b9ce1c1d0ec1f89dacc16e5d045314) --- diff --git a/apps/speed.c b/apps/speed.c index 6f392d2ade0..594fadfd5b0 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -506,7 +506,7 @@ static size_t kems_algs_len = 0; static char *kems_algname[MAX_KEM_NUM] = { NULL }; static double kems_results[MAX_KEM_NUM][3]; /* keygen, encaps, decaps */ -#define MAX_SIG_NUM 111 +#define MAX_SIG_NUM 256 static size_t sigs_algs_len = 0; static char *sigs_algname[MAX_SIG_NUM] = { NULL }; static double sigs_results[MAX_SIG_NUM][3]; /* keygen, sign, verify */ @@ -572,12 +572,12 @@ typedef struct loopargs_st { unsigned char *kem_out[MAX_KEM_NUM]; unsigned char *kem_send_secret[MAX_KEM_NUM]; unsigned char *kem_rcv_secret[MAX_KEM_NUM]; - EVP_PKEY_CTX *sig_gen_ctx[MAX_KEM_NUM]; - EVP_PKEY_CTX *sig_sign_ctx[MAX_KEM_NUM]; - EVP_PKEY_CTX *sig_verify_ctx[MAX_KEM_NUM]; - size_t sig_max_sig_len[MAX_KEM_NUM]; - size_t sig_act_sig_len[MAX_KEM_NUM]; - unsigned char *sig_sig[MAX_KEM_NUM]; + EVP_PKEY_CTX *sig_gen_ctx[MAX_SIG_NUM]; + EVP_PKEY_CTX *sig_sign_ctx[MAX_SIG_NUM]; + EVP_PKEY_CTX *sig_verify_ctx[MAX_SIG_NUM]; + size_t sig_max_sig_len[MAX_SIG_NUM]; + size_t sig_act_sig_len[MAX_SIG_NUM]; + unsigned char *sig_sig[MAX_SIG_NUM]; } loopargs_t; static int run_benchmark(int async_jobs, int (*loop_function) (void *), loopargs_t *loopargs);