AeadDecryptWithTag(Byte, Byte, Byte, AeadAlgorithm) Method |
Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext.
Namespace: CryptoSysAPIAssembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntaxpublic static byte[] DecryptWithTag(
byte[] input,
byte[] key,
byte[] iv,
AeadAlgorithm aeadAlg
)
Public Shared Function DecryptWithTag (
input As Byte(),
key As Byte(),
iv As Byte(),
aeadAlg As AeadAlgorithm
) As Byte()
Parameters
- input Byte
- Input data to be decrypted.
- key Byte
- Key of exact length for algorithm (16 or 32 bytes).
- iv Byte
- Initialization Vector (IV) (aka nonce) (12 or 16 bytes).
- aeadAlg AeadAlgorithm
- Authenticated encryption algorithm.
Return Value
BytePlaintext in a byte array, or empty array on error (an empty array may also be the correct result
- check
General.ErrorCode for details).
RemarksThe input must include the 16-byte tag appended to the ciphertext.
The output will be exactly 16 bytes shorter than the input.
In all cases the tag must be exactly 16 bytes (128 bits). The IV must be 16 bytes (128 bits) for ASCON-128 otherwise 12 bytes (96 bits).
See Also