but what does EVP_PKEY_CTX_set_signature_md do? The sign function EVP_PKEY_sign does not use the md used for creating the hash, which is the input of this function. In the same page is written:
"Similarly, an RSA implementation usually expects additional details to
be set, like the message digest algorithm that the input is supposed to
be digested with, as well as the padding mode"
Why is that? The sign function accepts the input data as is, and by what digest it is created does not matter to the signing right?
Stef Bon
Tomas Mraz
unread,
Jun 11, 2026, 2:32:34 AM (12 days ago) Jun 11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Stef Bon, openssl-users
Hi Stef,
It really depends on an algorithm. In particular the RSA PKCS#1v1.5
signatures encode the hash algorithm in the signature itself so the
signing operation needs to know the hash algorithm for proper
operation.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openssl-users, Tomas Mraz, Stef Bon
Ok,
so the signature contains a code about the hashalgorithm used?
I did not know that. Ok that explains it.
Since is also written:
"The functions described here can't be used to combine separate algorithms. In particular, neither EVP_PKEY_CTX_set_signature_md(3) nor the OSSL_PARAM parameter "digest" (OSSL_SIGNATURE_PARAM_DIGEST) can be used to combine a signature algorithm with a hash algorithm to process the input. "
That the hash algo used iis encoded n the signature is not documented.