crypto/cryptodev: export ivlen to support different cipher algs

Add ivlen field to crypt_op and crp_ivlen to cryptop structure to support
cipher algorithms with different IV lengths.

Signed-off-by: makejian <makejian@xiaomi.com>
This commit is contained in:
makejian 2025-05-21 14:25:51 +08:00 committed by Xiang Xiao
parent 143547128b
commit 66f9329839
2 changed files with 3 additions and 0 deletions

View file

@ -476,6 +476,7 @@ static int cryptodev_op(FAR struct csession *cse,
}
crp->crp_iv = cop->iv;
crp->crp_ivlen = cop->ivlen;
}
if (cop->dst)

View file

@ -201,6 +201,7 @@ struct cryptop
uint64_t crp_sid; /* Session ID */
int crp_ilen; /* Input data total length */
int crp_olen; /* Result total length */
int crp_ivlen; /* IV length */
int crp_alloctype; /* Type of buf to allocate if needed */
int crp_etype; /* Error type (zero means no error).
* All error codes except EAGAIN
@ -399,6 +400,7 @@ struct crypt_op
uint16_t flags;
unsigned len;
unsigned olen;
unsigned ivlen;
unsigned aadlen;
caddr_t src, dst; /* become iov[] inside kernel */
caddr_t mac; /* must be big enough for chosen MAC */