1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
12 @file rsa_sign_saltlen_get.c
13 Retrieve the maximum size of the salt, Steffen Jaeckel.
19 Retrieve the maximum possible size of the salt when creating a PKCS#1 PSS signature.
20 @param padding Type of padding (LTC_PKCS_1_PSS only)
21 @param hash_idx The index of the desired hash
22 @param key The RSA key
23 @return The maximum salt length in bytes or INT_MAX on error.
25 int rsa_sign_saltlen_get_max_ex(int padding, int hash_idx, rsa_key *key)
28 LTC_ARGCHK(key != NULL);
30 if ((hash_is_valid(hash_idx) == CRYPT_OK) &&
31 (padding == LTC_PKCS_1_PSS))
33 ret = rsa_get_size(key);
36 ret -= (hash_descriptor[hash_idx].hashsize + 2);
45 /* ref: $Format:%D$ */
46 /* git commit: $Format:%H$ */
47 /* commit time: $Format:%ai$ */