CryptoSys API Library Manual
aeadDecryptWithTag
Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext.
Syntax
[VBA]
Public Function aeadDecryptWithTag ( _
lpData() As Byte, _
lpKey() As Byte, _
lpNonce() As Byte, _
lpAAD() As Byte, _
nOptions As Long _
) As Byte()
Parameters
- lpData
- Input data to be decrypted.
- lpKey
- Key of exact length for algorithm (16 or 32 bytes).
- lpNonce
- Initialization Vector (IV) (aka nonce) exactly 16 bytes for ASCON else exactly 12 bytes long.
- lpAAD
- Additional authenticated data (optional) - set variable as
vbNullString
to ignore.
- nOptions
- Algorithm to be used. Select one from
API_AEAD_AES_128_GCM
API_AEAD_AES_256_GCM
API_AEAD_CHACHA20_POLY1305
API_AEAD_ASCON_128
API_AEAD_ASCON_128A
Add API_IV_PREFIX
to expect the IV to be prepended at the start of the input (use the Or
operator).
Return Value
Byte(): Plaintext in a byte array, or empty array on error (an empty array may also be the correct result).
Remarks
The input must include the 16-byte tag appended to the ciphertext.