aesCtr<T extends Object?> static method

T aesCtr<T extends Object?>(
  1. List<int> key,
  2. List<int> counter,
  3. T use(
    1. BuAesCtr cipher
    )
)

Runs use with a fresh AES-CTR cipher built from key/counter, then wipes it. The instance must be clean after you don't need it; this method guarantees that, even if use throws.

Implementation

static T aesCtr<T extends Object?>(
  List<int> key,
  List<int> counter,
  T Function(BuAesCtr cipher) use,
) {
  final cipher = aesCtrInstance(key, counter);
  try {
    return use(cipher);
  } finally {
    cipher.clean();
  }
}