beforeData method

  1. @override
void beforeData({
  1. required SecretKeyData secretKey,
  2. required List<int> nonce,
  3. List<int> aad = const [],
})
override

Called before data is added.

Implementation

@override
void beforeData({
  required SecretKeyData secretKey,
  required List<int> nonce,
  List<int> aad = const [],
}) {
  _initialState.fillRange(0, 16, 0);
  DartChacha20.initializeChacha(
    _initialState,
    key: secretKey.bytes,
    nonce: nonce,
  );
}