1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pub type Result<T> = ::std::result::Result<T, Error>;
#[derive(Debug, Fail)]
pub enum Error {
#[fail(display = "invalid padding scheme")]
InvalidPaddingScheme,
#[fail(display = "decryption error")]
Decryption,
#[fail(display = "verification error")]
Verification,
#[fail(display = "message too long")]
MessageTooLong,
#[fail(display = "input must be hashed")]
InputNotHashed,
#[fail(display = "nprimes must be >= 2")]
NprimesTooSmall,
#[fail(display = "too few primes of given length to generate an RSA key")]
TooFewPrimes,
#[fail(display = "invalid prime value")]
InvalidPrime,
#[fail(display = "invalid modulus")]
InvalidModulus,
#[fail(display = "invalid exponent")]
InvalidExponent,
#[fail(display = "public exponent too small")]
PublicExponentTooSmall,
#[fail(display = "public exponent too large")]
PublicExponentTooLarge,
#[fail(display = "internal error")]
Internal,
}