crypto_secretbox static method
Implementation
static Uint8List crypto_secretbox(
Uint8List c, Uint8List m, final int d, Uint8List n, Uint8List k) {
if (d < 32) {
throw 'SecretBox is invalid';
}
crypto_stream_xor(c, 0, m, 0, d, n, k);
_crypto_onetimeauth(c, 16, c, 32, d - 32, c);
// FIXME: Check in tweetnacl where these 16 bytes disappear?
//for (i = 0; i < 16; i++) c[i] = 0;
return c.sublist(16);
}