pub enum DecryptError<E, C = Infallible> {
Cipher(C),
Auth,
Malformed,
Sink(E),
}Expand description
Why decryption failed.
E is the sink’s error, C the cipher’s. walk involves no cipher,
so its C is Infallible.
The cipher’s and the sink’s errors are printed in the message rather
than chained as the source(), so neither type need implement Error.
Variants§
Cipher(C)
The cipher refused a leaf. For an AEAD that is a wrong key, a wrong AAD or a tampered leaf; a remote provider’s error type also tells an outage apart.
Auth
An authenticated empty marker carried a payload: tampering the cipher could not see.
Malformed
The tree or a leaf’s plaintext is not well formed, or the cipher returned the wrong number of leaves.
Sink(E)
The sink refused what it was given (a typed sink got the wrong kind, a host builder failed).
Implementations§
Source§impl<E> DecryptError<E>
impl<E> DecryptError<E>
Sourcepub fn with_cipher<C>(self) -> DecryptError<E, C>
pub fn with_cipher<C>(self) -> DecryptError<E, C>
The same failure, under any cipher error type: a walk’s error, as one step of a decryption.
Trait Implementations§
Source§impl<E, C> Display for DecryptError<E, C>
impl<E, C> Display for DecryptError<E, C>
Source§impl<E, C> Error for DecryptError<E, C>
impl<E, C> Error for DecryptError<E, C>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl<E: Error, C> Error for DecryptError<E, C>
Lets a ? on a sink error inside walk also accept source errors.
impl<E: Error, C> Error for DecryptError<E, C>
Lets a ? on a sink error inside walk also accept source errors.