cryptoSecretstreamXchacha20poly1305Push static method

Uint8List cryptoSecretstreamXchacha20poly1305Push(
  1. Pointer<Uint8> state,
  2. Uint8List m,
  3. Uint8List? ad,
  4. int tag,
)

Implementation

static Uint8List cryptoSecretstreamXchacha20poly1305Push(
    Pointer<Uint8> state, Uint8List m, Uint8List? ad, int tag) {
  final _c =
      calloc<Uint8>(m.length + cryptoSecretstreamXchacha20poly1305Abytes);
  final _clenP = calloc<Uint64>(1);
  final _m = m.toPointer();
  final _ad = ad?.toPointer() ?? nullptr;
  final _adlen = ad?.length ?? 0;
  try {
    _cryptoSecretStream
        .crypto_secretstream_xchacha20poly1305_push(
            state, _c, _clenP, _m, m.length, _ad, _adlen, tag)
        .mustSucceed('crypto_secretstream_xchacha20poly1305_push');

    return _c.toList(_clenP[0]);
  } finally {
    calloc.free(_c);
    calloc.free(_clenP);
    calloc.free(_m);
    calloc.free(_ad);
  }
}