Exceptions
HPKE-specific exception hierarchy. All exceptions inherit from HPKEError.
- exception rfc9180.exceptions.HPKEError[source]
Bases:
ExceptionBase exception for HPKE errors.
All HPKE-specific exceptions inherit from this class.
- exception rfc9180.exceptions.ValidationError[source]
Bases:
HPKEErrorKEM input/output validation failure.
Raised when KEM operations fail validation checks, such as all-zero DH outputs.
- exception rfc9180.exceptions.DeserializeError[source]
Bases:
HPKEErrorKey deserialization failure.
Raised when key deserialization fails due to invalid format or length.
- exception rfc9180.exceptions.EncapError[source]
Bases:
HPKEErrorEncapsulation failure.
Raised when key encapsulation operations fail.
- exception rfc9180.exceptions.DecapError[source]
Bases:
HPKEErrorDecapsulation failure.
Raised when key decapsulation operations fail.
- exception rfc9180.exceptions.OpenError[source]
Bases:
HPKEErrorAEAD decryption failure.
Raised when AEAD decryption operations fail, typically due to authentication failure or invalid ciphertext.
- exception rfc9180.exceptions.MessageLimitReachedError[source]
Bases:
HPKEErrorSequence number overflow.
Raised when the sequence number exceeds the maximum allowed value for the AEAD algorithm.
- exception rfc9180.exceptions.DeriveKeyPairError[source]
Bases:
HPKEErrorKey pair derivation failure.
Raised when key pair derivation fails, such as when rejection sampling exceeds the maximum number of iterations.
Exception Summary
ValidationError: KEM input/output validation (e.g. all-zero DH outputs)
DeserializeError: Invalid key format or length during deserialization
EncapError: Key encapsulation failure
DecapError: Key decapsulation failure (invalid enc, wrong key)
OpenError: AEAD decryption failure (tampered data, wrong key)
MessageLimitReachedError: Sequence number overflow (max messages exceeded)
DeriveKeyPairError: Key pair derivation failed (e.g. rejection sampling)