diff --git a/bls/Cargo.toml b/bls/Cargo.toml index 1ca213fe..2a7e9a56 100644 --- a/bls/Cargo.toml +++ b/bls/Cargo.toml @@ -4,12 +4,12 @@ edition = { workspace = true } authors = ["Grandine "] [features] -default = ["blst"] -blst = [ +default = ["bls-blst"] +bls-blst = [ "dep:blst", "dep:itertools" ] -bls12_381 = [ +bls-zkcrypto = [ "dep:bls12_381", "dep:ff", "dep:sha2", diff --git a/bls/src/backends/mod.rs b/bls/src/backends/mod.rs index f0f8a11a..1faf349f 100644 --- a/bls/src/backends/mod.rs +++ b/bls/src/backends/mod.rs @@ -1,5 +1,5 @@ -#[cfg(feature = "blst")] +#[cfg(feature = "bls-blst")] pub mod blst; -#[cfg(feature = "bls12_381")] -pub mod bls12_381; +#[cfg(feature = "bls-zkcrypto")] +pub mod zkcrypto; diff --git a/bls/src/backends/bls12_381/cached_public_key.rs b/bls/src/backends/zkcrypto/cached_public_key.rs similarity index 100% rename from bls/src/backends/bls12_381/cached_public_key.rs rename to bls/src/backends/zkcrypto/cached_public_key.rs diff --git a/bls/src/backends/bls12_381/mod.rs b/bls/src/backends/zkcrypto/mod.rs similarity index 100% rename from bls/src/backends/bls12_381/mod.rs rename to bls/src/backends/zkcrypto/mod.rs diff --git a/bls/src/backends/bls12_381/public_key.rs b/bls/src/backends/zkcrypto/public_key.rs similarity index 100% rename from bls/src/backends/bls12_381/public_key.rs rename to bls/src/backends/zkcrypto/public_key.rs diff --git a/bls/src/backends/bls12_381/public_key_bytes.rs b/bls/src/backends/zkcrypto/public_key_bytes.rs similarity index 100% rename from bls/src/backends/bls12_381/public_key_bytes.rs rename to bls/src/backends/zkcrypto/public_key_bytes.rs diff --git a/bls/src/backends/bls12_381/secret_key.rs b/bls/src/backends/zkcrypto/secret_key.rs similarity index 100% rename from bls/src/backends/bls12_381/secret_key.rs rename to bls/src/backends/zkcrypto/secret_key.rs diff --git a/bls/src/backends/bls12_381/secret_key_bytes.rs b/bls/src/backends/zkcrypto/secret_key_bytes.rs similarity index 100% rename from bls/src/backends/bls12_381/secret_key_bytes.rs rename to bls/src/backends/zkcrypto/secret_key_bytes.rs diff --git a/bls/src/backends/bls12_381/signature.rs b/bls/src/backends/zkcrypto/signature.rs similarity index 100% rename from bls/src/backends/bls12_381/signature.rs rename to bls/src/backends/zkcrypto/signature.rs diff --git a/bls/src/backends/bls12_381/signature_bytes.rs b/bls/src/backends/zkcrypto/signature_bytes.rs similarity index 100% rename from bls/src/backends/bls12_381/signature_bytes.rs rename to bls/src/backends/zkcrypto/signature_bytes.rs diff --git a/bls/src/error.rs b/bls/src/error.rs index b7d9ab7d..f869c091 100644 --- a/bls/src/error.rs +++ b/bls/src/error.rs @@ -1,4 +1,4 @@ -#[cfg(feature = "blst")] +#[cfg(feature = "bls-blst")] use blst::BLST_ERROR; #[derive(Debug, thiserror::Error)] @@ -13,12 +13,12 @@ pub enum Error { NoPublicKeysToAggregate, #[error("failed to decompress point")] DecompressionFailed, - #[cfg(feature = "blst")] + #[cfg(feature = "bls-blst")] #[error("blst error: {0:?}")] Blst(BLST_ERROR), } -#[cfg(feature = "blst")] +#[cfg(feature = "bls-blst")] impl From for Error { fn from(err: BLST_ERROR) -> Self { Self::Blst(err) diff --git a/bls/src/lib.rs b/bls/src/lib.rs index 3623678f..c96acf68 100644 --- a/bls/src/lib.rs +++ b/bls/src/lib.rs @@ -3,15 +3,15 @@ pub mod consts; pub mod error; pub mod traits; -#[cfg(feature = "blst")] +#[cfg(feature = "bls-blst")] pub use crate::backends::blst::{ cached_public_key::CachedPublicKey, public_key::PublicKey, public_key_bytes::PublicKeyBytes, secret_key::SecretKey, secret_key_bytes::SecretKeyBytes, signature::Signature, signature_bytes::SignatureBytes, }; -#[cfg(feature = "bls12_381")] -pub use crate::backends::bls12_381::{ +#[cfg(feature = "bls-zkcrypto")] +pub use crate::backends::zkcrypto::{ cached_public_key::CachedPublicKey, public_key::PublicKey, public_key_bytes::PublicKeyBytes, secret_key::SecretKey, secret_key_bytes::SecretKeyBytes, signature::Signature, signature_bytes::SignatureBytes,