s390/zcrypt: enable odd RSA modulus sizes in CRT format
In the past only even modulus sizes were allowed for RSA keys in CRT format. This restriction was based on limited RSA key generation on older crypto adapters that provides only even modulus sizes. This restriction is not valid any more. Revoke restrictions that crypto requests can be serviced with odd RSA modulus length in CRT format. Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:

committed by
Martin Schwidefsky

parent
b02064a9b8
commit
1330a1258d
@@ -291,7 +291,7 @@ static inline int zcrypt_type6_crt_key(struct ica_rsa_modexpo_crt *crt,
|
||||
|
||||
memset(key, 0, sizeof(*key));
|
||||
|
||||
short_len = crt->inputdatalength / 2;
|
||||
short_len = (crt->inputdatalength + 1) / 2;
|
||||
long_len = short_len + 8;
|
||||
pad_len = -(3*long_len + 2*short_len) & 7;
|
||||
key_len = 3*long_len + 2*short_len + pad_len + crt->inputdatalength;
|
||||
|
Reference in New Issue
Block a user