mirror of
https://github.com/apache/nuttx.git
synced 2026-08-02 04:38:59 +00:00
in user space
Use the flag (COP_FLAG_UPDATE)structure member to mark
whether it is just input data.
like this:
can do manys times,just input data
....
cryp.ses = session.ses;
cryp.op = COP_ENCRYPT;
cryp.src = (caddr_t) s;
cryp.len = len;
cryp.flags = COP_FLAG_UPDATE;
cryp.dst = 0;
cryp.mac = (caddr_t) out;
cryp.iv = 0;
if (ioctl(cryptodev_fd, CIOCCRYPT, &cryp) == -1)
{
warn("CIOCCRYPT");
goto err;
}
can do manys times like frist...
then,the last time
Don't use any flay structure member to mark
this is last time,need get final result
....
cryp.ses = session.ses;
cryp.op = COP_ENCRYPT;
cryp.src = (caddr_t) s;
cryp.len = len;
cryp.flags = 0;
cryp.dst = 0;
cryp.mac = (caddr_t) out;
cryp.iv = 0;
if (ioctl(cryptodev_fd, CIOCCRYPT, &cryp) == -1)
{
warn("CIOCCRYPT");
goto err;
}
....
that will get last result.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
|
||
|---|---|---|
| .. | ||
| aes.h | ||
| blf.h | ||
| cast.h | ||
| chachapoly.h | ||
| cmac.h | ||
| cryptodev.h | ||
| cryptosoft.h | ||
| gmac.h | ||
| hmac.h | ||
| idgen.h | ||
| key_wrap.h | ||
| md5.h | ||
| poly1305.h | ||
| rijndael.h | ||
| rmd160.h | ||
| sha1.h | ||
| sha2.h | ||
| siphash.h | ||
| xform.h | ||