mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +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.c | ||
| blake2s.c | ||
| blf.c | ||
| cast.c | ||
| castsb.h | ||
| chacha_private.h | ||
| chachapoly.c | ||
| cmac.c | ||
| crypto.c | ||
| cryptodev.c | ||
| cryptosoft.c | ||
| des_locl.h | ||
| ecb3_enc.c | ||
| ecb_enc.c | ||
| gmac.c | ||
| hmac.c | ||
| hmac_buff.c | ||
| idgen.c | ||
| Kconfig | ||
| key_wrap.c | ||
| Makefile | ||
| md5.c | ||
| podd.h | ||
| poly1305.c | ||
| random_pool.c | ||
| rijndael.c | ||
| rmd160.c | ||
| set_key.c | ||
| sha1.c | ||
| sha2.c | ||
| siphash.c | ||
| sk.h | ||
| spr.h | ||
| testmngr.c | ||
| testmngr.h | ||
| xform.c | ||