diff --git a/src/hash/hashing.rs b/src/hash/hashing.rs index a63106be..309182dc 100644 --- a/src/hash/hashing.rs +++ b/src/hash/hashing.rs @@ -13,13 +13,6 @@ pub(crate) const SPONGE_RATE: usize = 8; pub(crate) const SPONGE_CAPACITY: usize = 4; pub const SPONGE_WIDTH: usize = SPONGE_RATE + SPONGE_CAPACITY; -// pub(crate) const HASH_FAMILY: HashFamily = HashFamily::Poseidon; -// -// pub(crate) enum HashFamily { -// GMiMC, -// Poseidon, -// } - /// Hash the vector if necessary to reduce its length to ~256 bits. If it already fits, this is a /// no-op. pub fn hash_or_noop>(inputs: Vec) -> HashOut { diff --git a/src/hash/poseidon.rs b/src/hash/poseidon.rs index b94cc481..377ff2b7 100644 --- a/src/hash/poseidon.rs +++ b/src/hash/poseidon.rs @@ -10,6 +10,7 @@ use crate::field::extension_field::{Extendable, FieldExtension}; use crate::field::field_types::{Field, PrimeField, RichField}; use crate::gates::gate::Gate; use crate::gates::poseidon_mds::PoseidonMdsGate; +use crate::hash::hashing::SPONGE_WIDTH; use crate::plonk::circuit_builder::CircuitBuilder; // The number of full rounds and partial rounds is given by the @@ -144,7 +145,7 @@ pub const ALL_ROUND_CONSTANTS: [u64; MAX_WIDTH * N_ROUNDS] = [ 0x4543d9df72c4831d, 0xf172d73e69f20739, 0xdfd1c4ff1eb3d868, 0xbc8dfb62d26376f7, ]; -const WIDTH: usize = 12; +const WIDTH: usize = SPONGE_WIDTH; pub trait Poseidon: PrimeField { // Total number of round constants required: width of the input // times number of rounds.