#[non_exhaustive]pub enum OreError {
InitFailed,
PrpError(PrpError),
Random(RandomError),
VariableLength,
TooManyBlocks,
ExceedsPadding,
TooLong,
TrailingNul,
TargetMismatch,
}Expand description
Errors returned by scheme initialisation and encryption.
New schemes and policies add variants, so the enum is non-exhaustive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InitFailed
Cipher initialisation failed (e.g., key material rejected by an underlying primitive).
PrpError(PrpError)
A pseudo-random permutation primitive returned an error.
Random(RandomError)
The OS random number generator could not seed the scheme’s generator, from which every per-ciphertext nonce is drawn.
VariableLength
A text or bytes plaintext, whose width varies, on a fixed-width scheme. Only the chained scheme takes them.
TooManyBlocks
The plaintext exceeds the maximum block count the wire format can
represent (the chained scheme encodes the block count as a u16).
ExceedsPadding
A string longer than the fixed length its padding policy pads to.
TooLong
A string longer than the cipher’s ceiling
(scheme::chained::Options::max_bytes).
TrailingNul
A string that ends in NUL, refused by a padding policy: padded with NULs, it would encrypt the same as the string without them.
TargetMismatch
A plaintext encoded as another target than the space it was handed
to (BlockOre’s encrypt_plaintext or encrypt_query called
directly, with a space of another target).
Trait Implementations§
Source§impl Error for OreError
impl Error for OreError
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()