Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/crypto/merkle_tree/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use ark_crypto_primitives::{
};
use ark_ff::Field;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use rand::RngCore;
use rand::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
use spongefish::{
ByteDomainSeparator, BytesToUnitDeserialize, BytesToUnitSerialize, DomainSeparator, ProofError,
ProofResult, ProverState, VerifierState,
ByteDomainSeparator, BytesToUnitDeserialize, BytesToUnitSerialize, DomainSeparator,
DuplexSpongeInterface, ProofError, ProofResult, ProverState, Unit, VerifierState,
};

use super::{digest::GenericDigest, IdentityDigestConverter};
Expand Down Expand Up @@ -84,7 +84,12 @@ where
}
}

impl HintSerialize for ProverState {
impl<H, U, R> HintSerialize for ProverState<H, U, R>
where
U: Unit,
H: DuplexSpongeInterface<U>,
R: RngCore + CryptoRng,
{
fn hint<T: CanonicalSerialize>(&mut self, hint: &T) -> ProofResult<()> {
let mut bytes = Vec::new();
hint.serialize_compressed(&mut bytes)?;
Expand All @@ -107,7 +112,11 @@ where
}
}

impl HintDeserialize for VerifierState<'_> {
impl<H, U> HintDeserialize for VerifierState<'_, H, U>
where
U: Unit,
H: DuplexSpongeInterface<U>,
{
fn hint<T: CanonicalDeserialize>(&mut self) -> ProofResult<T> {
let mut bytes = self.hint_bytes()?;
Ok(T::deserialize_compressed(&mut bytes)?)
Expand Down
2 changes: 1 addition & 1 deletion src/ntt/cooley_tukey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl<F: Field> NttEngine<F> {
}

/// Returns a cached table of roots of unity of the given order.
fn roots_table(&self, order: usize) -> RwLockReadGuard<Vec<F>> {
fn roots_table(&self, order: usize) -> RwLockReadGuard<'_, Vec<F>> {
// Precompute more roots of unity if requested.
let roots = self.roots.read().unwrap();
if roots.is_empty() || roots.len() % order != 0 {
Expand Down
Loading