xsalsa20Poly1305Decrypt static method
Decrypt with XSalsa20-Poly1305. Throws CryptoException on
authentication failure.
Implementation
static BuBytes xsalsa20Poly1305Decrypt({
required List<int> key,
required List<int> nonce,
required List<int> cipherText,
}) {
return xsalsa20Poly1305(key, (box) {
final decrypt = box.decrypt(nonce, cipherText);
if (decrypt != null) {
return decrypt;
}
throw CoreErrors.cryptoFailed(
"xsalsa20Poly1305Decrypt",
reason: "Decryption failed.",
);
});
}