Skip to content

Commit

Permalink
Avoid duplicate crates (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Michele Orrù <m@orru.net>
  • Loading branch information
rex4539 and mmaker authored Mar 1, 2025
1 parent 3a83250 commit 97a8d61
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 46 deletions.
32 changes: 32 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,38 @@ members = [
"nimue-poseidon",
]

[workspace.dependencies]
anemoi = { git = "https://github.com/mmaker/anemoi" }
anyhow = "1.0.75"
ark-bls12-381 = "0.5"
ark-bn254 = "0.5"
ark-curve25519 = "0.5.0"
ark-ec = "0.5"
ark-ff = "0.5"
ark-pallas = "0.5"
ark-serialize = "0.5"
ark-std = "0.5.0"
ark-vesta = "0.5"
arrayvec = "0.7.6"
blake2 = "0.10.6"
blake3 = "1.5.4"
bls12_381 = "0.8.0"
bytemuck = "1.17.1"
curve25519-dalek = "4.0.0"
digest = "0.10.7"
group = "0.13.0"
hex = "0.4.3"
keccak = "0.1.4"
log = "0.4.20"
nimue = { path = "nimue" }
pallas = "0.31"
pasta_curves = "0.5.1"
rand = "0.8.5"
rayon = "1.10.0"
sha2 = "0.10.7"
sha3 = "0.10.8"
zeroize = "1.8.1"


# Un-comment below for latest arkworks libraries.
# [patch.crates-io]
Expand Down
12 changes: 6 additions & 6 deletions nimue-anemoi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2021"
license = "MIT/Apache-2.0"

[dependencies]
ark-ff = "^0.5"
nimue = { path = "../nimue", features = ["ark"] }
zeroize = "1.8.1"
anemoi = {git = "https://github.com/mmaker/anemoi", features=["bls12_381"]}
ark-bls12-381 = "^0.5"
arrayvec = "0.7.6"
ark-ff = { workspace = true }
nimue = { workspace = true, features = ["ark"] }
zeroize = { workspace = true }
anemoi = { workspace = true, features = ["bls12_381"] }
ark-bls12-381 = { workspace = true }
arrayvec = { workspace = true }
14 changes: 7 additions & 7 deletions nimue-poseidon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ edition = "2021"
license = "MIT/Apache-2.0"

[dependencies]
nimue = { path = "../nimue", features = ["ark"]}
ark-ff = "^0.5"
zeroize = "1.8.1"
ark-bls12-381 = {version = "^0.5", optional = true}
ark-bn254 = {version = "^0.5", optional = true}
nimue = { workspace = true, features = ["ark"] }
ark-ff = { workspace = true }
zeroize = { workspace = true }
ark-bls12-381 = { workspace = true, optional = true }
ark-bn254 = { workspace = true, optional = true }

[dev-dependencies]
ark-bls12-381 = "^0.5"
ark-bls12-381 = { workspace = true }

[features]
bn254 = ["ark-bn254"]
Expand All @@ -21,4 +21,4 @@ bls12-381 = ["nimue/ark", "dep:ark-bls12-381"]

[[example]]
name = "schnorr_algebraic_hash"
required-features = ["ark-bls12-381"]
required-features = ["ark-bls12-381"]
14 changes: 7 additions & 7 deletions nimue-pow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ authors = [
license = "BSD-3-Clause"

[dependencies]
nimue = { path = "../nimue" }
blake3 = "1.5.4"
keccak = { version = "0.1.4"}
bytemuck = "1.17.1"
rayon = { version = "1.10.0", optional = true }
rand = "0.8.5"
nimue = { workspace = true }
blake3 = { workspace = true }
keccak = { workspace = true }
bytemuck = { workspace = true }
rayon = { workspace = true, optional = true }
rand = { workspace = true }

[features]
default = ["parallel"]
parallel = ["dep:rayon"]
parallel = ["dep:rayon"]
48 changes: 24 additions & 24 deletions nimue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ edition = "2021"
license = "BSD-3-Clause"

[dependencies]
zeroize = { version = "1.6.0", features = ["zeroize_derive"] }
rand = { version = "0.8", features = ["getrandom"] }
digest = "^0.10.7"
zeroize = { workspace = true, features = ["zeroize_derive"] }
rand = { workspace = true, features = ["getrandom"] }
digest = { workspace = true }
# used as default hasher for the prover
keccak = { version = "0.1.4"}
log = "0.4.20"
keccak = { workspace = true }
log = { workspace = true }
# optional dependencies
ark-ff = { version = "^0.5", optional = true }
ark-ec = { version = "^0.5", optional = true }
ark-serialize = { version = "^0.5", optional = true, features = ["std"] }
group = { version = "0.13.0", optional = true }
hex = "0.4.3"
ark-ff = { workspace = true, optional = true }
ark-ec = { workspace = true, optional = true }
ark-serialize = { workspace = true, features = ["std"], optional = true }
group = { workspace = true, optional = true }
hex = { workspace = true }

[features]
default = []
Expand All @@ -27,22 +27,22 @@ group = ["dep:group"]
asm = ["keccak/asm", "keccak/simd"]

[dev-dependencies]
ark-std = "^0.5.0"
sha2 = "0.10.7"
blake2 = "0.10.6"
hex = "0.4.3"
ark-std = { workspace = true }
sha2 = { workspace = true }
blake2 = { workspace = true }
hex = { workspace = true }
# test curve25519 compatibility
curve25519-dalek = { version = "4.0.0", features = ["group"] }
ark-curve25519 = "0.5.0"
curve25519-dalek = { workspace = true, features = ["group"] }
ark-curve25519 = { workspace = true }
# test algebraic hashers
bls12_381 = "0.8.0"
ark-bls12-381 = { version = "^0.5", features = ["std"] }
anyhow = { version = "1.0.75", features = ["backtrace"] }
ark-pallas = { version = "^0.5", features = ["std"] }
pallas = "^0.31"
pasta_curves = "0.5.1"
ark-vesta = { version = "^0.5", features = ["std"] }
sha3 = "0.10.8"
bls12_381 = { workspace = true }
ark-bls12-381 = { workspace = true, features = ["std"] }
anyhow = { workspace = true, features = ["backtrace"] }
ark-pallas = { workspace = true, features = ["std"] }
pallas = { workspace = true }
pasta_curves = { workspace = true }
ark-vesta = { workspace = true, features = ["std"] }
sha3 = { workspace = true }

[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "../doc/katex-header.html", "--cfg", "docsrs"]
Expand Down
4 changes: 2 additions & 2 deletions nimue/src/hash/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
//! `squeeze_unchecked` will use the squeeze oracle to output `output.len()` bytes,
//! and finally `squeeze_end` will set the state `cv` to the current squeeze digest and length.
//!
use digest::{core_api::BlockSizeUser, typenum::Unsigned, Digest, FixedOutputReset, Reset};
use digest::crypto_common::generic_array::GenericArray;
use digest::{core_api::BlockSizeUser, typenum::Unsigned, Digest, FixedOutputReset, Reset};
use zeroize::Zeroize;

use super::DuplexHash;

/// A Bridge to our sponge interface for legacy `Digest` implementations.
#[derive(Clone)]
pub struct DigestBridge<D: Digest + Clone + Reset + BlockSizeUser> {
pub struct DigestBridge<D: Digest + Clone + Reset + BlockSizeUser> {
/// The underlying hasher.
hasher: D,
/// Cached digest
Expand Down

0 comments on commit 97a8d61

Please # to comment.