cryptoBoxDetachedAfternm static method
Implementation
static DetachedCipher cryptoBoxDetachedAfternm(
Uint8List m, Uint8List n, Uint8List k) {
RangeError.checkValueInInterval(n.length, cryptoBoxNoncebytes,
cryptoBoxNoncebytes, 'n', 'Invalid length');
RangeError.checkValueInInterval(k.length, cryptoBoxBeforenmbytes,
cryptoBoxBeforenmbytes, 'k', 'Invalid length');
final _c = calloc<Uint8>(m.length);
final _mac = calloc<Uint8>(cryptoBoxMacbytes);
final _m = m.toPointer();
final _n = n.toPointer();
final _k = k.toPointer();
try {
_cryptoBox
.crypto_box_detached_afternm(_c, _mac, _m, m.length, _n, _k)
.mustSucceed('crypto_box_detached_afternm');
return DetachedCipher(
c: _c.toList(m.length), mac: _mac.toList(cryptoBoxMacbytes));
} finally {
calloc.free(_c);
calloc.free(_mac);
calloc.free(_m);
calloc.free(_n);
calloc.free(_k);
}
}