Skip to main content

om_crypto_types/
error.rs

1use thiserror::Error;
2
3/// Error type for publishable cryptography-related types.
4#[derive(Error, Debug, Clone, PartialEq, Eq)]
5pub enum CryptoError {
6    #[error("Invalid message: {0}")]
7    InvalidMessage(String),
8
9    #[error("Invalid key: {0}")]
10    InvalidKey(String),
11
12    #[error("Invalid public key: {0}")]
13    InvalidPublicKey(String),
14
15    #[error("Invalid signature: {0}")]
16    InvalidSignature(String),
17
18    #[error("Signature verification failed: {0}")]
19    SignatureVerificationError(String),
20
21    #[error("Proof-of-possession error: {0}")]
22    ProofOfPossessionError(String),
23
24    #[error("Cannot aggregate empty list")]
25    EmptyAggregationList,
26}
27
28pub type CryptoResult<T> = Result<T, CryptoError>;