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
..
2022-08-02 21:04:19 +08:00
2022-07-27 00:36:49 +08:00
2022-12-09 11:19:55 +08:00
2023-01-06 22:20:19 +08:00
2023-01-06 22:20:19 +08:00
2022-12-21 10:56:45 +08:00
2022-02-20 21:58:10 +08:00
2022-12-21 10:56:45 +08:00
2022-10-28 02:19:26 +08:00
2022-08-09 22:13:09 +03:00
2022-07-27 00:36:49 +08:00
2022-12-10 02:36:24 +08:00
2022-03-17 09:37:15 +02:00
2022-04-17 23:32:05 +03:00
2023-01-12 09:28:04 -03:00