ferveo_common_nucypher_temp3/
lib.rs1pub mod keypair;
2pub mod serialization;
3
4use std::{fmt, fmt::Formatter};
5
6pub use keypair::*;
7pub use serialization::*;
8
9#[derive(Debug)]
10pub enum Error {
11 InvalidByteLength(usize, usize),
12 SerializationError(ark_serialize::SerializationError),
13 InvalidSeedLength(usize),
14}
15
16impl fmt::Display for Error {
17 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
18 match self {
19 Error::InvalidByteLength(expected, actual) => {
20 write!(
21 f,
22 "Invalid byte length: expected {expected}, actual {actual}"
23 )
24 }
25 Error::SerializationError(e) => {
26 write!(f, "Serialization error: {e}")
27 }
28 Error::InvalidSeedLength(len) => {
29 write!(f, "Invalid seed length: {len}")
30 }
31 }
32 }
33}
34
35type Result<T> = std::result::Result<T, Error>;