Skip to content

Commit

Permalink
Remove unused crypto dependencies in narwhal (MystenLabs#5406)
Browse files Browse the repository at this point in the history
* Remove unused dependencies

* Remove hkdf and k256

* Remove signature

* Update workspace hack Cargo.toml

* Bls12377 needs the signature crate
  • Loading branch information
jonas-lj authored Oct 20, 2022
1 parent 781b13d commit 2a2875e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions crates/workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ axum-core = { version = "0.2", default-features = false }
axum-server = { version = "0.4" }
backoff = { version = "0.4", features = ["futures", "futures-core", "pin-project-lite", "tokio", "tokio_1"] }
backtrace = { version = "0.3", features = ["std"] }
base16ct = { version = "0.1", default-features = false, features = ["alloc"] }
base16ct = { version = "0.1", default-features = false }
base64 = { version = "0.13", features = ["alloc", "std"] }
base64ct = { version = "1", default-features = false, features = ["alloc", "std"] }
bcs = { version = "0.1", default-features = false }
Expand Down Expand Up @@ -165,12 +165,12 @@ dotenvy = { version = "0.15", default-features = false }
downcast = { version = "0.11", features = ["std"] }
duration-str = { version = "0.4", features = ["chrono", "serde", "time"] }
dyn-clone = { version = "1", default-features = false }
ecdsa = { version = "0.14", default-features = false, features = ["alloc", "arithmetic", "der", "digest", "hazmat", "pkcs8", "rfc6979", "sign", "std", "verify"] }
ecdsa = { version = "0.14", default-features = false, features = ["arithmetic", "der", "digest", "hazmat", "rfc6979", "sign", "verify"] }
ed25519 = { version = "1", features = ["alloc", "pkcs8", "serde", "std", "zeroize"] }
ed25519-consensus = { version = "2", features = ["serde", "std", "thiserror"] }
ed25519-dalek-fiat = { version = "0.1", default-features = false, features = ["fiat_u64_backend", "rand", "serde", "serde_bytes", "serde_crate", "std"] }
either = { version = "1", features = ["use_std"] }
elliptic-curve = { version = "0.12", default-features = false, features = ["alloc", "arithmetic", "digest", "ff", "group", "hazmat", "pkcs8", "sec1", "std"] }
elliptic-curve = { version = "0.12", default-features = false, features = ["arithmetic", "digest", "ff", "group", "hazmat", "sec1"] }
endian-type = { version = "0.1", default-features = false }
env_logger = { version = "0.9", features = ["atty", "humantime", "regex", "termcolor"] }
ethnum = { version = "1", default-features = false }
Expand Down Expand Up @@ -268,7 +268,7 @@ jsonrpsee-types = { version = "0.15", default-features = false }
jsonrpsee-wasm-client = { version = "0.15", default-features = false }
jsonrpsee-ws-client = { version = "0.15", features = ["tls"] }
jsonrpsee-ws-server = { version = "0.15", default-features = false }
k256 = { version = "0.11", features = ["arithmetic", "digest", "ecdsa", "ecdsa-core", "keccak256", "pkcs8", "schnorr", "sha2", "sha256", "sha3", "std"] }
k256 = { version = "0.11", default-features = false, features = ["arithmetic", "digest", "ecdsa", "ecdsa-core", "keccak256", "sha2", "sha256", "sha3"] }
keccak = { version = "0.1", default-features = false }
lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false }
lazy_static-dff4ba8e3ae991db = { package = "lazy_static", version = "1", default-features = false }
Expand Down Expand Up @@ -459,7 +459,7 @@ same-file = { version = "1", default-features = false }
schemars = { version = "0.8", features = ["derive", "either", "schemars_derive"] }
scopeguard = { version = "1", features = ["use_std"] }
sct = { version = "0.7", default-features = false }
sec1 = { version = "0.3", features = ["alloc", "base16ct", "der", "generic-array", "pkcs8", "point", "subtle", "zeroize"] }
sec1 = { version = "0.3", features = ["base16ct", "der", "generic-array", "point", "subtle", "zeroize"] }
secp256k1 = { version = "0.24", features = ["alloc", "bitcoin_hashes", "global-context", "rand", "rand-std", "recovery", "std"] }
secp256k1-sys = { version = "0.6", default-features = false, features = ["alloc", "recovery", "std"] }
semver-dff4ba8e3ae991db = { package = "semver", version = "1", features = ["serde", "std"] }
Expand Down Expand Up @@ -666,7 +666,7 @@ axum-core = { version = "0.2", default-features = false }
axum-server = { version = "0.4" }
backoff = { version = "0.4", features = ["futures", "futures-core", "pin-project-lite", "tokio", "tokio_1"] }
backtrace = { version = "0.3", features = ["std"] }
base16ct = { version = "0.1", default-features = false, features = ["alloc"] }
base16ct = { version = "0.1", default-features = false }
base64 = { version = "0.13", features = ["alloc", "std"] }
base64ct = { version = "1", default-features = false, features = ["alloc", "std"] }
bcs = { version = "0.1", default-features = false }
Expand Down Expand Up @@ -799,12 +799,12 @@ dotenvy = { version = "0.15", default-features = false }
downcast = { version = "0.11", features = ["std"] }
duration-str = { version = "0.4", features = ["chrono", "serde", "time"] }
dyn-clone = { version = "1", default-features = false }
ecdsa = { version = "0.14", default-features = false, features = ["alloc", "arithmetic", "der", "digest", "hazmat", "pkcs8", "rfc6979", "sign", "std", "verify"] }
ecdsa = { version = "0.14", default-features = false, features = ["arithmetic", "der", "digest", "hazmat", "rfc6979", "sign", "verify"] }
ed25519 = { version = "1", features = ["alloc", "pkcs8", "serde", "std", "zeroize"] }
ed25519-consensus = { version = "2", features = ["serde", "std", "thiserror"] }
ed25519-dalek-fiat = { version = "0.1", default-features = false, features = ["fiat_u64_backend", "rand", "serde", "serde_bytes", "serde_crate", "std"] }
either = { version = "1", features = ["use_std"] }
elliptic-curve = { version = "0.12", default-features = false, features = ["alloc", "arithmetic", "digest", "ff", "group", "hazmat", "pkcs8", "sec1", "std"] }
elliptic-curve = { version = "0.12", default-features = false, features = ["arithmetic", "digest", "ff", "group", "hazmat", "sec1"] }
endian-type = { version = "0.1", default-features = false }
enum_dispatch = { version = "0.3", default-features = false }
env_logger = { version = "0.9", features = ["atty", "humantime", "regex", "termcolor"] }
Expand Down Expand Up @@ -914,7 +914,7 @@ jsonrpsee-types = { version = "0.15", default-features = false }
jsonrpsee-wasm-client = { version = "0.15", default-features = false }
jsonrpsee-ws-client = { version = "0.15", features = ["tls"] }
jsonrpsee-ws-server = { version = "0.15", default-features = false }
k256 = { version = "0.11", features = ["arithmetic", "digest", "ecdsa", "ecdsa-core", "keccak256", "pkcs8", "schnorr", "sha2", "sha256", "sha3", "std"] }
k256 = { version = "0.11", default-features = false, features = ["arithmetic", "digest", "ecdsa", "ecdsa-core", "keccak256", "sha2", "sha256", "sha3"] }
keccak = { version = "0.1", default-features = false }
lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false }
lazy_static-dff4ba8e3ae991db = { package = "lazy_static", version = "1", default-features = false }
Expand Down Expand Up @@ -1143,7 +1143,7 @@ schemars = { version = "0.8", features = ["derive", "either", "schemars_derive"]
schemars_derive = { version = "0.8", default-features = false }
scopeguard = { version = "1", features = ["use_std"] }
sct = { version = "0.7", default-features = false }
sec1 = { version = "0.3", features = ["alloc", "base16ct", "der", "generic-array", "pkcs8", "point", "subtle", "zeroize"] }
sec1 = { version = "0.3", features = ["base16ct", "der", "generic-array", "point", "subtle", "zeroize"] }
secp256k1 = { version = "0.24", features = ["alloc", "bitcoin_hashes", "global-context", "rand", "rand-std", "recovery", "std"] }
secp256k1-sys = { version = "0.6", default-features = false, features = ["alloc", "recovery", "std"] }
semver-a6292c17cd707f01 = { package = "semver", version = "0.11" }
Expand Down
11 changes: 2 additions & 9 deletions narwhal/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ publish = false
[dependencies]
ark-bls12-377 = { version = "0.3.0", features = ["std"], optional = true }
base64ct = { version = "1.5.2", features = ["alloc"] }
ed25519-consensus = { version = "2.0.1", features = ["serde"] }
eyre = "0.6.8"
hex = "0.4.3"
hkdf = { version = "0.12.3", features = ["std"] }
rand = { version = "0.8.5", features = ["std"] }
rust_secp256k1 = { version = "0.24.0", package = "secp256k1", features = ["recovery", "rand-std", "bitcoin_hashes", "global-context"] }
serde = { version = "1.0.144", features = ["derive"] }
serde_bytes = "0.11.7"
serde_with = "2.0.1"
signature = "1.6.1"
signature = { version = "1.6.1", optional = true }
tokio = { version = "1.20.1", features = ["sync", "rt", "macros"] }
zeroize = "1.5.7"
bulletproofs = "4.0.0"
curve25519-dalek-ng = "4.1.1"
merlin = "3.0.0"

# TODO: switch to https://github.com/celo-org/celo-bls-snark-rs
Expand All @@ -34,20 +29,18 @@ ark-ec = { version = "0.3.0", features = ["std"], optional = true }
ark-ff = { version = "0.3.0", features = ["std"], optional = true }
ark-serialize = { version = "0.3.0", features = ["std"], optional = true }
ark-std = { version = "0.3.0", features = ["std"], optional = true }
blst = "0.3.10"
once_cell = "1.14.0"
readonly = "0.2.2"
workspace-hack.workspace = true

[features]
default = []
celo = ["ark-ec", "ark-ff", "ark-serialize", "ark-bls12-377", "ark-std", "celo-bls"]
celo = ["ark-ec", "ark-ff", "ark-serialize", "ark-bls12-377", "ark-std", "celo-bls", "signature"]

[dev-dependencies]
bincode = "1.3.3"
criterion = "0.3.6"
hex-literal = "0.3.4"
k256 = { version = "0.11.5", features = ["ecdsa", "sha256", "keccak256"] }
proptest = "1.0.0"
proptest-derive = "0.3.0"
serde_json = "1.0.85"
Expand Down

0 comments on commit 2a2875e

Please sign in to comment.