On 11-05-2021 17:55, Dimitry Sibiryakov wrote:
11.05.2021 17:41, Mark Rotteveel wrote:
Then I propose to at least rename the function to RSA_SIGN_HASH so it
1) matches the TomCrypt function name it basically calls directly, and
2) makes clear that it doesn't sign a message, but a hash, and sort
the rest out later.
But such change raises the question "what to hell parameter HASH does
there?"
The TomCrypt documentation[1] says:
"""
This will PSS encode the message digest pointed to by in of length inlen
octets. Next, the PSS encoded hash will be RSA signed and the output
stored in the buffer pointed to by out of length outlen octets. The
hash_idx parameter indicates which hash will be used to create the PSS
encoding.
It should be the same as the hash used to hash the message being signed.
The saltlen parameter indicates the length of the desired salt, and
should typically be small. A good default value is between 8 and 16
octets. Strictly, it must be small than modulus_len − hLen − 2 where
modulus_len is the size of the RSA modulus (in octets), and hLen is the
length of the message digest produced by the chosen hash
"""
It doesn't explain why
[1]:
https://github.com/libtom/libtomcrypt/releases/download/v1.18.2/crypt-1.18.2.pdf
--
Mark Rotteveel
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel