#[non_exhaustive]pub enum BufferedError<E = Infallible> {
NotInitialized,
OutputTooShort {
required: usize,
available: usize,
},
InputTooLong,
IncompleteLastBlock,
CorruptPadding,
PaddingFailed,
BufferTooSmall {
required: usize,
available: usize,
},
Cipher(E),
}Expand description
A failure of a buffered adapter; E is the wrapped cipher’s processing
error, Infallible where there is none.
The AEAD adapters report their engine’s own error instead.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotInitialized
Processing was requested before successful initialization.
OutputTooShort
The output buffer is shorter than required.
Fields
InputTooLong
The length of the input exceeds what can be counted, or, for an asymmetric cipher, what one block takes.
IncompleteLastBlock
Finalization found a trailing partial block it cannot resolve.
Decrypting a padded message requires a whole number of blocks, and an unpadded mode that rejects partial blocks requires the same.
CorruptPadding
The padding on the final block was rejected.
Callers must not report this separately from an authentication failure: distinguishing the two is what a padding oracle needs.
PaddingFailed
The padding scheme could not pad the final block.
BufferTooSmall
A fixed-size adapter’s buffer is shorter than the cipher needs under the
key given to init.
Fields
Cipher(E)
The wrapped cipher failed; source returns its error.
Trait Implementations§
Source§impl<E: Clone> Clone for BufferedError<E>
impl<E: Clone> Clone for BufferedError<E>
impl<E: Copy> Copy for BufferedError<E>
Source§impl<E: Debug> Debug for BufferedError<E>
impl<E: Debug> Debug for BufferedError<E>
Source§impl<E> Display for BufferedError<E>
impl<E> Display for BufferedError<E>
impl<E: Eq> Eq for BufferedError<E>
Source§impl<E: Error + 'static> Error for BufferedError<E>
impl<E: Error + 'static> Error for BufferedError<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the cipher’s error for Cipher, and None otherwise. Constant time.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()