crypto_stream_xor static method

int crypto_stream_xor(
  1. Uint8List c,
  2. int cpos,
  3. Uint8List m,
  4. int mpos,
  5. int d,
  6. Uint8List n,
  7. Uint8List k,
)

Implementation

static int crypto_stream_xor(Uint8List c, int cpos, Uint8List m, int mpos,
    int d, Uint8List n, Uint8List k) {
  final s = Uint8List(32);

  crypto_core_hsalsa20(s, n, k, _sigma);
  final sn = Uint8List(8);

  for (var i = 0; i < 8; i++) {
    sn[i] = n[i + 16];
  }

  return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s);
}