mbedtls_rsa_rsassa_pss_sign() is only used within mbedTLS.
 
Symbols
loading...
Files
loading...
SummarySyntaxArgumentsRelatedReferences

Return value

\c 0 if the signing operation was successful. An \c MBEDTLS_ERR_RSA_XXX error code on failure.

Notes

The \p hash_id in the RSA context is the one used for the encoding. \p md_alg in the function call is the type of hash that is encoded. According to RFC-3447: Public-Key Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography Specifications it is advised to keep both hashes the same. This function always uses the maximum possible salt size, up to the length of the payload hash. This choice of salt size complies with FIPS 186-4 §5.5 (e) and RFC 8017 (PKCS#1 v2.2) §9.1.1 step 3. Furthermore this function enforces a minimum salt size which is the hash size minus 2 bytes. If this minimum size is too large given the key size (the salt size, plus the hash size, plus 2 bytes must be no more than the key size in bytes), this function returns #MBEDTLS_ERR_RSA_BAD_INPUT_DATA. Alternative implementations of RSA need not support mode being set to #MBEDTLS_RSA_PUBLIC and might instead return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.

References

from examples