aesEcb<T extends Object?> static method
T
aesEcb<T extends Object?>(
- List<
int> key, - T use(
- BuAesEcb cipher
- PaddingAlgorithm? padding = PaddingAlgorithm.pkcs7,
Runs use with a fresh AES-ECB cipher, 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 aesEcb<T extends Object?>(
List<int> key,
T Function(BuAesEcb cipher) use, {
PaddingAlgorithm? padding = PaddingAlgorithm.pkcs7,
}) {
final cipher = aesEcbInstance(key, padding: padding);
try {
return use(cipher);
} finally {
cipher.clean();
}
}