Skip to content

Commit

Permalink
Add bls flag to allow disabling blst dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-dumitrescu committed Nov 21, 2023
1 parent 6675c1c commit 9b9ec0f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- Nothing.
- Added `bls` feature flag to allow disabling dependency on `blst`

### Changed

Expand Down
5 changes: 3 additions & 2 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ 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 }

[dev-dependencies]
serde_json = "1.0"

[features]
default = ["std"]
default = ["std", "bls"]
bls = ["blst"]
std = ["rand/std", "num-bigint/rand", "libsecp256k1/std", "p256/std", "proptest"]
3 changes: 3 additions & 0 deletions crypto/src/bls.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// SPDX-FileCopyrightText: 2022-2023 TriliTech <contact@trili.tech>
// SPDX-FileCopyrightText: 2023 Nomadic Labs <contact@nomadic-labs.com>
//
// SPDX-License-Identifier: MIT

//! BLS support (min_pk).

#![cfg(feature = "bls")]

use crate::hash::BlsSignature;
use crate::hash::ContractTz4Hash;
use crate::hash::PublicKeyBls;
Expand Down
2 changes: 2 additions & 0 deletions crypto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-CopyrightText: 2023 TriliTech <contact@trili.tech>
// SPDX-CopyrightText: 2023 Nomadic Labs <contact@nomadic-labs.com>
// SPDX-License-Identifier: MIT
#![forbid(unsafe_code)]
#![cfg_attr(feature = "fuzzing", feature(no_coverage))]
Expand All @@ -9,6 +10,7 @@ use thiserror::Error;
#[macro_use]
pub mod blake2b;
pub mod base58;
#[cfg(feature = "bls")]
pub mod bls;
#[macro_use]
pub mod hash;
Expand Down
4 changes: 2 additions & 2 deletions tezos-encoding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ default-features = false
path = "../tezos-encoding-derive"
version = "0.5.1"

[features]

[dev-dependencies]
serde_json = "1.0"

[features]

0 comments on commit 9b9ec0f

Please sign in to comment.