diff --git a/crypto/Cargo.toml b/crypto/Cargo.toml index 67d48b3888..80f112f22f 100644 --- a/crypto/Cargo.toml +++ b/crypto/Cargo.toml @@ -27,7 +27,7 @@ strum_macros = "0.20" zeroize = { version = "1.5" } ed25519-dalek = { version = "2.0.0", default-features = false } cryptoxide = { version = "0.4.4", default-features = false, features = ["sha2", "blake2"] } -blst = "=0.3.10" +blst = { version = "0.3.10", optional = true } proptest = { version = "1.1", optional = true } @@ -35,5 +35,6 @@ proptest = { version = "1.1", optional = true } serde_json = "1.0" [features] -default = ["std"] +default = ["std", "blst"] +blst = ["dep:blst"] std = ["rand/std", "num-bigint/rand", "libsecp256k1/std", "p256/std", "proptest"] diff --git a/crypto/src/bls.rs b/crypto/src/bls.rs index 3517e59e79..828020f852 100644 --- a/crypto/src/bls.rs +++ b/crypto/src/bls.rs @@ -4,6 +4,8 @@ //! BLS support (min_pk). +#![cfg(feature = "blst")] + use crate::hash::BlsSignature; use crate::hash::ContractTz4Hash; use crate::hash::PublicKeyBls; diff --git a/crypto/src/lib.rs b/crypto/src/lib.rs index b55206e981..673f35fdcc 100644 --- a/crypto/src/lib.rs +++ b/crypto/src/lib.rs @@ -9,6 +9,7 @@ use thiserror::Error; #[macro_use] pub mod blake2b; pub mod base58; +#[cfg(feature = "blst")] pub mod bls; #[macro_use] pub mod hash; diff --git a/tezos-encoding/Cargo.toml b/tezos-encoding/Cargo.toml index 8cc37dd5ba..6115c9ca2b 100644 --- a/tezos-encoding/Cargo.toml +++ b/tezos-encoding/Cargo.toml @@ -30,7 +30,8 @@ default-features = false path = "../tezos-encoding-derive" version = "0.5.1" -[features] - [dev-dependencies] serde_json = "1.0" + +[features] +blst = ["tezos_crypto_rs/blst"]