-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modularised bls crate to have mulitple backend impl
- Loading branch information
1 parent
047520e
commit fcbb8ec
Showing
81 changed files
with
1,304 additions
and
539 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
|
@@ -6,24 +6,11 @@ authors = ["Grandine <[email protected]>"] | |
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
blst = { workspace = true } | ||
derivative = { workspace = true } | ||
derive_more = { workspace = true } | ||
fixed-hash = { workspace = true } | ||
hex = { workspace = true } | ||
impl-serde = { workspace = true } | ||
itertools = { workspace = true } | ||
once_cell = { workspace = true } | ||
rand = { workspace = true } | ||
serde = { workspace = true } | ||
serde_utils = { workspace = true } | ||
ssz = { workspace = true } | ||
static_assertions = { workspace = true } | ||
thiserror = { workspace = true } | ||
typenum = { workspace = true } | ||
zeroize = { workspace = true } | ||
[features] | ||
blst = ["dep:bls-blst"] | ||
zkcrypto = ["dep:bls-zkcrypto"] | ||
|
||
[dev-dependencies] | ||
std_ext = { workspace = true } | ||
tap = { workspace = true } | ||
[dependencies] | ||
bls-core = { workspace = true } | ||
bls-blst = { workspace = true, optional = true } | ||
bls-zkcrypto = { workspace = true, optional = true } |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[package] | ||
name = "bls-blst" | ||
edition = { workspace = true } | ||
|
||
[dependencies] | ||
bls-core = { workspace = true } | ||
blst = { workspace = true } | ||
derivative = { workspace = true } | ||
derive_more = { workspace = true } | ||
fixed-hash = { workspace = true } | ||
hex = { workspace = true } | ||
impl-serde = { workspace = true } | ||
itertools = { workspace = true } | ||
once_cell = { workspace = true } | ||
rand = { workspace = true } | ||
serde = { workspace = true } | ||
serde_utils = { workspace = true } | ||
ssz = { workspace = true } | ||
static_assertions = { workspace = true } | ||
typenum = { workspace = true } | ||
zeroize = { workspace = true } | ||
|
||
[dev-dependencies] | ||
std_ext = { workspace = true } | ||
tap = { workspace = true } |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use super::{public_key::PublicKey, public_key_bytes::PublicKeyBytes}; | ||
|
||
use bls_core::{impl_cached_public_key, traits::CachedPublicKey as CachedPublicKeyTrait}; | ||
|
||
impl_cached_public_key!( | ||
CachedPublicKeyTrait, | ||
CachedPublicKey, | ||
PublicKeyBytes, | ||
PublicKey | ||
); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pub mod cached_public_key; | ||
pub mod public_key; | ||
pub mod public_key_bytes; | ||
pub mod secret_key; | ||
pub mod secret_key_bytes; | ||
pub mod signature; | ||
pub mod signature_bytes; |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use derive_more::derive::AsRef; | ||
use fixed_hash::construct_fixed_hash; | ||
use impl_serde::impl_fixed_hash_serde; | ||
|
||
use bls_core::{impl_public_key_bytes, traits::COMPRESSED_SIZE}; | ||
|
||
use super::public_key::PublicKey; | ||
|
||
construct_fixed_hash! { | ||
#[derive(AsRef)] | ||
pub struct PublicKeyBytes(COMPRESSED_SIZE); | ||
} | ||
|
||
impl_fixed_hash_serde!(PublicKeyBytes, COMPRESSED_SIZE); | ||
|
||
impl_public_key_bytes!(PublicKeyBytes); | ||
|
||
impl From<PublicKey> for PublicKeyBytes { | ||
#[inline] | ||
fn from(public_key: PublicKey) -> Self { | ||
Self(public_key.as_raw().compress()) | ||
} | ||
} |
Oops, something went wrong.