mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
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:
parent
66f9ced0cb
commit
143547128b
2 changed files with 5 additions and 0 deletions
|
|
@ -277,6 +277,7 @@ static int cryptof_ioctl(FAR struct file *filep,
|
|||
{
|
||||
crie.cri_alg = sop->cipher;
|
||||
crie.cri_klen = sop->keylen * 8;
|
||||
crie.cri_op = sop->op;
|
||||
|
||||
crie.cri_key = kmm_malloc(crie.cri_klen / 8);
|
||||
if (crie.cri_key == NULL)
|
||||
|
|
@ -461,6 +462,7 @@ static int cryptodev_op(FAR struct csession *cse,
|
|||
}
|
||||
|
||||
crp->crp_ilen = cop->len;
|
||||
crp->crp_olen = cop->olen;
|
||||
crp->crp_buf = cop->src;
|
||||
crp->crp_sid = cse->sid;
|
||||
crp->crp_opaque = cse;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue