1use thiserror::Error;
19
20#[derive(Error, Debug, PartialEq, Eq, Clone)]
21#[repr(C)]
22pub enum CryptoError {
23 #[error("Key has incorrect length - should be 32 bytes long. Key length = {0}")]
24 KeyParsingError(usize),
25 #[error("Cannot verify message: {0}")]
26 MessageVerificationError(String),
27 #[error("Invalid key signature: {0}")]
28 InvalidSignatureBytesError(String),
29 #[error("Failed to create a mnemonic: {0}")]
30 MnemonicGenerationError(String),
31 #[error("Identity generation failed: {0}")]
32 IdentityGenerationError(String),
33 #[error("Too low entropy")]
34 EntropyTooLow,
35 #[error("Could not decrypt content")]
36 DecryptionError,
37}
38
39#[derive(Error, Debug, PartialEq, Eq, Clone)]
40#[error("Error while deriving an extended secret key fom the current using a derivation path: {0}")]
41pub struct KeyDeriveError(pub String);