CryptoSys PKI Pro Manual

cipherDecryptAEAD_2

Decrypt data using Authenticated Encryption with Associated Data (AEAD) with parameters arranged for ease of use. The authentication tag is expected to be appended to the input ciphertext.

Syntax

[VBA]
Public Function cipherDecryptAEAD_2 ( _
    lpInput() As Byte, _
    lpKey() As Byte, _
    nOptions As Long, _
    Optional ByRef lpIV As Variant, _
    Optional ByRef lpAAD As Variant _
) As Byte()

Parameters

lpInput
Input data to be decrypted.
lpKey
Key of exact length for algorithm (16, 24 or 32 bytes).
nOptions
Algorithm to be used. Select one from
PKI_AEAD_AES_128_GCM
PKI_AEAD_AES_192_GCM
PKI_AEAD_AES_256_GCM
PKI_AEAD_CHACHA20_POLY1305
Add PKI_IV_PREFIX to expect the IV to be prepended at the start of the input.
lpIV
Initialization Vector (IV, aka nonce) (optional). Required if IV is not prepended to the input. If present, must be an array of bytes exactly 12 bytes long.
lpAAD
Additional authenticated data (optional). If present, expected to be an array of bytes exactly equal to the AAD used for encryption.

Return Value

Byte(): Plaintext in a byte array, or empty array on error (an empty array may also trivially be the correct result).

Remarks

The input must include the 16-byte tag appended to the ciphertext. Note the change in argument order from cipherDecryptAEAD. New in v23.1.0a.
[PREV: cipherDecryptAEAD...]   [Contents]   [Index]   
   [NEXT: cipherDecryptBytes...]

Copyright © 2004-26 D.I. Management Services Pty Ltd. All rights reserved. Generated 2026-05-09T05:51:34Z.