Skip to content

Commit

Permalink
poseidon: Update dependencies
Browse files Browse the repository at this point in the history
- Update `dusk-plonk` to 0.19
- Update `dusk-poseidon` to 0.33
  • Loading branch information
moCello committed Jan 3, 2024
1 parent 1c58dc8 commit d6430ff
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
5 changes: 5 additions & 0 deletions poseidon-merkle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Update `dusk-plonk` to 0.19
- Update `dusk-poseidon` to 0.33

## [0.4.0] - 2023-12-13

### Changed
Expand Down
4 changes: 2 additions & 2 deletions poseidon-merkle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ license = "MPL-2.0"

[dependencies]
dusk-merkle = "0.5"
dusk-poseidon = { version = "0.32", default-features = false, features = ["merkle"] }
dusk-poseidon = { version = "0.33", default-features = false, features = ["merkle"] }
dusk-bls12_381 = { version = "0.13", default-features = false }
dusk-plonk = { version = "0.18", optional = true, default-features = false }
dusk-plonk = { version = "0.19", optional = true, default-features = false }
rkyv = { version = "0.7", optional = true, default-features = false }
bytecheck = { version = "0.6", optional = true, default-features = false }

Expand Down
5 changes: 1 addition & 4 deletions poseidon-merkle/benches/zk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ impl OpeningCircuit {
}

impl Circuit for OpeningCircuit {
fn circuit<C>(&self, composer: &mut C) -> Result<(), Error>
where
C: Composer,
{
fn circuit(&self, composer: &mut Composer) -> Result<(), Error> {
// append the leaf and opening gadget to the circuit
let leaf = composer.append_witness(self.leaf.hash);
let computed_root = opening_gadget(composer, &self.opening, leaf);
Expand Down
5 changes: 1 addition & 4 deletions poseidon-merkle/examples/zk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ impl OpeningCircuit {
}

impl Circuit for OpeningCircuit {
fn circuit<C>(&self, composer: &mut C) -> Result<(), Error>
where
C: Composer,
{
fn circuit(&self, composer: &mut Composer) -> Result<(), Error> {
// append the leaf and opening gadget to the circuit
let leaf = composer.append_witness(self.leaf.hash);
let computed_root = opening_gadget(composer, &self.opening, leaf);
Expand Down
9 changes: 4 additions & 5 deletions poseidon-merkle/src/zk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ use dusk_poseidon::sponge::merkle::gadget as poseidon_merkle_gadget;

/// Builds the gadget for the poseidon opening and returns the computed
/// root.
pub fn opening_gadget<T, C, const H: usize, const A: usize>(
composer: &mut C,
pub fn opening_gadget<T, const H: usize, const A: usize>(
composer: &mut Composer,
opening: &Opening<T, H, A>,
leaf: Witness,
) -> Witness
where
T: Clone + Aggregate<A>,
C: Composer,
{
// append the siblings and position to the circuit
let mut level_witnesses = [[C::ZERO; A]; H];
let mut level_witnesses = [[Composer::ZERO; A]; H];
// if i == position: pos_bits[i] = 1 else: pos_bits[i] = 0
let mut pos_bits = [[C::ZERO; A]; H];
let mut pos_bits = [[Composer::ZERO; A]; H];
for h in (0..H).rev() {
let level = &opening.branch()[h];
for (i, item) in level.iter().enumerate() {
Expand Down
5 changes: 1 addition & 4 deletions poseidon-merkle/tests/zk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ impl OpeningCircuit {
}

impl Circuit for OpeningCircuit {
fn circuit<C>(&self, composer: &mut C) -> Result<(), Error>
where
C: Composer,
{
fn circuit(&self, composer: &mut Composer) -> Result<(), Error> {
// append the leaf and opening gadget to the circuit
let leaf = composer.append_witness(self.leaf.hash);
let computed_root = opening_gadget(composer, &self.opening, leaf);
Expand Down

0 comments on commit d6430ff

Please sign in to comment.