Skip to content

Commit

Permalink
crypto: add multisig types
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Feb 24, 2024
1 parent 3612056 commit 10eb2d5
Show file tree
Hide file tree
Showing 5 changed files with 405 additions and 11 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ rustdoc-args = [

[features]
default = []
serde = ["dep:serde", "dep:serde_derive", "dep:serde_with"]
serde = ["dep:serde", "dep:serde_derive", "dep:serde_with", "dep:bcs", "roaring/std"]
rand = ["dep:rand_core"]
hash = ["dep:blake2"]

[dependencies]
base64ct = "1.6.0"
base64ct = { version = "1.6.0", features = ["alloc"] }
bs58 = "0.5.0"
hex = "0.4.3"
roaring = { version = "0.10.3", default-features = false }

# Serialization and Deserialization support
serde = { version = "1.0.197", optional = true }
serde_derive = { version = "1.0.197", optional = true }
serde_with = { version = "3.6.1", default-features = false, optional = true }
serde_with = { version = "3.6.1", default-features = false, features = ["alloc"], optional = true }
bcs = { version = "0.1.6", optional = true }

# RNG support
rand_core = { version = "0.6.4", optional = true }
Expand Down
5 changes: 5 additions & 0 deletions src/types/crypto/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
mod bls12381;
mod ed25519;
mod multisig;
mod secp256k1;
mod secp256r1;
mod signature;

pub use bls12381::{Bls12381PrivateKey, Bls12381PublicKey, Bls12381Signature};
pub use ed25519::{Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature};
pub use multisig::{
MultisigAggregatedSignature, MultisigCommittee, MultisigMember, MultisigMemberSignature,
};
pub use secp256k1::{Secp256k1PrivateKey, Secp256k1PublicKey, Secp256k1Signature};
pub use secp256r1::{Secp256r1PrivateKey, Secp256r1PublicKey, Secp256r1Signature};
pub use signature::{SignatureScheme, SimpleSignature, UserSignature};
Expand Down Expand Up @@ -108,6 +112,7 @@ macro_rules! impl_base64_helper {

impl_base64_helper!(Base64Array32, Base64Display32, Base64FromStr32, test32, 32);
impl_base64_helper!(Base64Array33, Base64Display33, Base64FromStr33, test33, 33);
impl_base64_helper!(Base64Array34, Base64Display34, Base64FromStr34, test34, 34);
impl_base64_helper!(Base64Array48, Base64Display48, Base64FromStr48, test48, 48);
impl_base64_helper!(Base64Array64, Base64Display64, Base64FromStr64, test64, 64);
impl_base64_helper!(Base64Array96, Base64Display96, Base64FromStr96, test96, 96);
Loading

0 comments on commit 10eb2d5

Please sign in to comment.