Implement Clone trait for Hash, Absorbing, and Sponge structs (#171)

This commit is contained in:
Enrico Bottazzi 2023-04-27 09:02:08 +02:00 committed by GitHub
parent 5f7cfcd4b6
commit 17e9765c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -166,7 +166,7 @@ mod private {
pub trait SpongeMode: private::SealedSpongeMode {}
/// The absorbing state of the `Sponge`.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Absorbing<F, const RATE: usize>(pub(crate) SpongeRate<F, RATE>);
/// 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.
pub(crate) struct Sponge<
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.
pub struct Hash<
F: Field,