aesEcbDecrypt static method
Decrypt the input data using AES(ECB)
Implementation
static BuBytes aesEcbDecrypt(
List<int> key,
List<int> data, {
PaddingAlgorithm? paddingAlgorithm,
}) {
final ecb = blockchainUtils.api.blockCipher.aesEcb(
key,
padding: paddingAlgorithm,
);
try {
final decrypt = ecb.decrypt(data)?.asBytes;
if (decrypt == null) {
throw CoreErrors.cryptoFailed(
"aesEcbDecrypt",
reason: "Decryption failed.",
);
}
return decrypt;
} finally {
ecb.clean();
}
}