baml.crypto.DecryptionFailure

A ciphertext was rejected: it did not authenticate under the key, nonce, and associated data it was decrypted with.

Reference version

Signature

class baml.crypto.DecryptionFailure

A ciphertext was rejected: it did not authenticate under the key, nonce, and associated data it was decrypted with.

reason is coarse by design. AEAD authentication is all or nothing, and an implementation that reported why a tag failed to verify would give an attacker a decryption oracle. So reason never distinguishes a wrong key from a wrong nonce, mismatched aad, or tampered ciphertext. It names only facts the caller already holds, such as the ciphertext being too short to contain a tag at all.

Source:<builtin>/baml/ns_crypto/errors.bamlbytes 544805

Fields

algorithm

string

The algorithm that rejected the ciphertext, such as "AES-256-GCM-SIV".

reason

string

A short description of the failure, never specific enough to identify which input was wrong.

Implementations

baml.Concrete for T

Source:<builtin>/baml/core.bamlbytes 747779