mirror of https://github.com/zcash/halo2.git
Implement Clone trait for Hash, Absorbing, and Sponge structs (#171)
This commit is contained in:
parent
5f7cfcd4b6
commit
17e9765c19
|
@ -166,7 +166,7 @@ mod private {
|
||||||
pub trait SpongeMode: private::SealedSpongeMode {}
|
pub trait SpongeMode: private::SealedSpongeMode {}
|
||||||
|
|
||||||
/// The absorbing state of the `Sponge`.
|
/// The absorbing state of the `Sponge`.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Absorbing<F, const RATE: usize>(pub(crate) SpongeRate<F, RATE>);
|
pub struct Absorbing<F, const RATE: usize>(pub(crate) SpongeRate<F, RATE>);
|
||||||
|
|
||||||
/// The squeezing state of the `Sponge`.
|
/// The squeezing state of the `Sponge`.
|
||||||
|
@ -188,6 +188,7 @@ impl<F: fmt::Debug, const RATE: usize> Absorbing<F, RATE> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
/// A Poseidon sponge.
|
/// A Poseidon sponge.
|
||||||
pub(crate) struct Sponge<
|
pub(crate) struct Sponge<
|
||||||
F: Field,
|
F: Field,
|
||||||
|
@ -329,6 +330,7 @@ impl<F: PrimeField, const RATE: usize, const L: usize> Domain<F, RATE> for Const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
/// A Poseidon hash function, built around a sponge.
|
/// A Poseidon hash function, built around a sponge.
|
||||||
pub struct Hash<
|
pub struct Hash<
|
||||||
F: Field,
|
F: Field,
|
||||||
|
|
Loading…
Reference in New Issue