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-01-29 01:04:23 +08:00
2022-12-21 10:56:45 +08:00
2022-02-20 21:58:10 +08:00
2021-11-23 20:34:56 +09:00
2021-11-23 20:34:56 +09:00
2021-11-23 20:34:56 +09: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
2021-08-02 08:23:35 -03:00
2021-09-25 07:54:39 -03:00
2021-03-02 03:44:06 -08:00
2022-07-27 00:36:49 +08:00
2021-07-31 15:35:47 -03:00
2022-12-10 02:36:24 +08:00
2021-01-06 14:23:50 +08:00
2021-05-12 21:08:23 -07: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
2021-07-09 15:51:28 -03:00
2020-07-21 21:48:18 -07:00