cryptoOnetimeauthInit static method

Pointer<Uint8> cryptoOnetimeauthInit(
  1. Uint8List key
)

Implementation

static Pointer<Uint8> cryptoOnetimeauthInit(Uint8List key) {
  RangeError.checkValueInInterval(key.length, cryptoOnetimeauthKeybytes,
      cryptoOnetimeauthKeybytes, 'key', 'Invalid length');

  final _state = calloc<Uint8>(cryptoOnetimeauthStatebytes);
  final _k = key.toPointer();
  try {
    _cryptoOnetimeauth
        .crypto_onetimeauth_init(_state, _k)
        .mustSucceed('crypto_onetimeauth_init');
    return _state;
  } finally {
    calloc.free(_k);
  }
}