field_encryption/
error.rs1use regex_automata::Error as AutomatonError;
2use std::string::FromUtf8Error;
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum Error {
7 #[error("Regex must have bounded size")]
8 InfiniteRegex,
9 #[error("Error building automation")]
10 AutomatonError(#[from] AutomatonError),
11 #[error("Fiestal must have odd number of rounds")]
12 EvenFiestalRounds,
13 #[error("Ouput regex must have number of variants greater than or equal to input regex")]
14 OutputDomainTooSmall,
15 #[error("Invalid input value {0}")]
16 InvalidInput(String),
17 #[error("Invalid output offset {0}")]
18 InvalidOutputOffset(u128),
19 #[error(transparent)]
20 InvalidStringBytes(#[from] FromUtf8Error),
21 #[error("Invalid key length {0}")]
22 InvalidKeyLength(usize),
23 #[error("Invalid key expansion length")]
24 InvalidKeyExpansion(usize),
25 #[error("Regex domain is greater than usize::MAX in size")]
26 DomainTooBig,
27}