On 05/11/2016 06:55 AM, David Howells wrote: > Tadeusz Struk <tadeusz.struk@xxxxxxxxx> wrote: > >>> (2) rsa-pkcs1pad needs to indicate what the maximum content size is, given >>> the minimum possible padding for the specified hash type (ie. a >>> particular OID). >> >> The user needs to use crypto_akcipher_maxsize(tfm) to get the required buffer >> size for a given key. >> We do check if the buffer if big enough to accommodate padding and hash info. >> This is needed in sign and encrypt operations, and in both cases we check it, >> sign: >> https://git.kernel.org/cgit/linux/kernel/git/herbert/cryptodev-2.6.git/tree/crypto/rsa-pkcs1pad.c#n434 >> and encrypt: >> https://git.kernel.org/cgit/linux/kernel/git/herbert/cryptodev-2.6.git/tree/crypto/rsa-pkcs1pad.c#n252 > > Can you supply a way to find out the reduced size from the padding? > Hi David, What exactly do you want to do? For the verify operation we don't know the reduced size before the operation. We only figure it out after we decrypt the message and then the req->dst_len gets the actual size of the message without padding. Thanks, -- TS -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html