forked from anoma/ferveo
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat! use static arrays in ferveo public key serialization
- Loading branch information
1 parent
8dc57d3
commit f9ac1d7
Showing
8 changed files
with
188 additions
and
96 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,36 @@ | ||
pub mod keypair; | ||
pub mod serialization; | ||
|
||
use std::{fmt, fmt::Formatter}; | ||
|
||
pub use keypair::*; | ||
pub use serialization::*; | ||
|
||
#[derive(Debug)] | ||
pub enum Error { | ||
InvalidByteLength(usize, usize), | ||
SerializationError(ark_serialize::SerializationError), | ||
InvalidSeedLength(usize), | ||
} | ||
|
||
impl fmt::Display for Error { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { | ||
match self { | ||
Error::InvalidByteLength(expected, actual) => { | ||
write!( | ||
f, | ||
"Invalid byte length: expected {}, actual {}", | ||
expected, actual | ||
) | ||
} | ||
Error::SerializationError(e) => { | ||
write!(f, "Serialization error: {}", e) | ||
} | ||
Error::InvalidSeedLength(len) => { | ||
write!(f, "Invalid seed length: {}", len) | ||
} | ||
} | ||
} | ||
} | ||
|
||
type Result<T> = std::result::Result<T, Error>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.