crypto/cryptodev: add encrypt op and olen for support virtio mode

Add olen field to crypt_op structure and crp_olen to cryptop structure
to support output length tracking in virtio crypto mode.

Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian
2026-01-21 00:25:07 +08:00
committed by Xiang Xiao
parent 66f9ced0cb
commit 143547128b
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -152,6 +152,7 @@ struct cryptoini
int cri_klen; /* Key length, in bits */
int cri_rnd; /* Algorithm rounds, where relevant */
int cri_sid;
int cri_op;
caddr_t cri_key; /* key to use */
union
{
@@ -363,6 +364,7 @@ struct cryptocap
struct session_op
{
uint32_t cipher; /* ie. CRYPTO_AES_EBC */
uint16_t op; /* i.e. COP_ENCRYPT */
uint32_t mac;
uint32_t keylen; /* cipher key */
caddr_t key;
@@ -396,6 +398,7 @@ struct crypt_op
uint16_t flags;
unsigned len;
unsigned olen;
unsigned aadlen;
caddr_t src, dst; /* become iov[] inside kernel */
caddr_t mac; /* must be big enough for chosen MAC */