cryptoSecretboxEasy static method
Implementation
static Uint8List cryptoSecretboxEasy(Uint8List m, Uint8List n, Uint8List k) {
RangeError.checkValueInInterval(n.length, cryptoSecretboxNoncebytes,
cryptoSecretboxNoncebytes, 'n', 'Invalid length');
RangeError.checkValueInInterval(k.length, cryptoSecretboxKeybytes,
cryptoSecretboxKeybytes, 'k', 'Invalid length');
final _c = calloc<Uint8>(m.length + cryptoSecretboxMacbytes);
final _m = m.toPointer();
final _n = n.toPointer();
final _k = k.toPointer();
try {
_cryptoSecretbox
.crypto_secretbox_easy(_c, _m, m.length, _n, _k)
.mustSucceed('crypto_secretbox_easy');
return _c.toList(m.length + cryptoSecretboxMacbytes);
} finally {
calloc.free(_c);
calloc.free(_m);
calloc.free(_n);
calloc.free(_k);
}
}