AEADCipher.open
ubyte[] open(const(ubyte)[] ciphertext, const(ubyte)[] aad, const(ubyte)[] nonce, ubyte[] output = null)Decrypts and verifies data.
Parameters
ciphertext | The data to decrypt (must include the tag). |
aad | Additional Authenticated Data. |
nonce | The nonce/IV used for the matching seal call. |
output | Optional output buffer. If provided, it must be at least ciphertext.length - tagSize bytes; a ciphertext shorter than tagSize is rejected with CryptoException, as is a too-small output. |
Returns
The plaintext if verification succeeds.
Throws
CryptoException if verification fails or the buffer is too small.
Note
This method throws an exception on authentication failure, which may
introduce timing variations. For timing-sensitive applications, callers should catch exceptions and handle all error paths with uniform timing to prevent timing side-channel attacks.