nuttx/crypto
anjiahao 43d2c595b1 crypto:support crypto can handle streaming data
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>
2023-01-17 01:19:38 +08:00
..
aes.c
blake2s.c
blf.c
cast.c
castsb.h
chacha_private.h
chachapoly.c
cmac.c
crypto.c
cryptodev.c crypto:support crypto can handle streaming data 2023-01-17 01:19:38 +08:00
cryptosoft.c crypto:support crypto can handle streaming data 2023-01-17 01:19:38 +08:00
des_locl.h
ecb3_enc.c
ecb_enc.c
gmac.c
hmac_buff.c
hmac.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