crypto: export rsa with pkcs1.5 and pss mode

Add support for exporting RSA operations with PKCS#1 v1.5 and PSS padding schemes through the cryptodev interface.

This enables both traditional and modern RSA signature schemes:
- CRK_RSA_PKCS15_SIGN/VERIFY for PKCS#1 v1.5 padding
- CRK_RSA_PSS_SIGN/VERIFY for PSS padding

Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian 2024-11-05 16:06:59 +08:00 committed by Xiang Xiao
parent f3e2a7029d
commit 2878fa3c38
2 changed files with 44 additions and 17 deletions

View file

@ -558,6 +558,13 @@ static int cryptodev_key(FAR struct fcrypt *fcr, FAR struct crypt_kop *kop)
break;
}
return -EINVAL;
case CRK_RSA_PKCS15_SIGN:
if (in == 4 && out == 1)
{
break;
}
return -EINVAL;
case CRK_RSA_PKCS15_VERIFY:
if (in == 5 && out == 0)
@ -565,6 +572,20 @@ static int cryptodev_key(FAR struct fcrypt *fcr, FAR struct crypt_kop *kop)
break;
}
return -EINVAL;
case CRK_RSA_PSS_SIGN:
if (in == 3 && out == 1)
{
break;
}
return -EINVAL;
case CRK_RSA_PSS_VERIFY:
if (in == 4 && out == 0)
{
break;
}
return -EINVAL;
case CRK_ECDSA_SECP256R1_SIGN:
if (in == 2 && out == 2)