crypto_secretbox static method

int crypto_secretbox(
  1. Uint8List c,
  2. Uint8List m,
  3. int d,
  4. Uint8List n,
  5. Uint8List k,
)

Implementation

static int crypto_secretbox(
    Uint8List c, Uint8List m, int d, Uint8List n, Uint8List k) {
  int i;
  if (d < 32) return -1;
  crypto_stream_xor(c, 0, m, 0, d, n, k);
  _crypto_onetimeauth(c, 16, c, 32, d - 32, c);

  ///for (i = 0; i < 16; i++) c[i] = 0;
  return 0;
}