Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirhemo committed Sep 19, 2023
1 parent e4839d9 commit a65c049
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion curta/src/chip/hash/sha/sha256/builder_gadget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use plonky2::field::extension::Extendable;
use plonky2::hash::hash_types::RichField;
use plonky2::iop::target::Target;
use plonky2::plonk::circuit_builder::CircuitBuilder;
use serde::{Serialize, Deserialize};
use serde::{Deserialize, Serialize};

use super::generator::{SHA256AirParameters, SHA256Generator, SHA256HintGenerator};
use super::SHA256PublicData;
Expand Down
30 changes: 15 additions & 15 deletions curta/src/chip/hash/sha/sha256/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ use plonky2::plonk::circuit_data::CommonCircuitData;
use plonky2::util::serialization::{Buffer, Read, Write};
use serde::{Deserialize, Serialize};

use crate::chip::builder::AirBuilder;
use crate::plonky2::stark::Starky;
use crate::plonky2::stark::prover::StarkyProver;
use crate::plonky2::stark::verifier::set_stark_proof_target;
use super::{SHA256Gadget, SHA256PublicData, INITIAL_HASH, ROUND_CONSTANTS};
use crate::chip::builder::AirBuilder;
use crate::chip::register::Register;
use crate::chip::trace::generator::ArithmeticGenerator;
use crate::chip::uint::operations::instruction::U32Instruction;
use crate::chip::uint::register::U32Register;
use crate::chip::uint::util::u32_to_le_field_bytes;
use crate::chip::AirParameters;
use crate::math::prelude::{CubicParameters, *};
use crate::plonky2::stark::config::{StarkyConfig, CurtaConfig};
use crate::plonky2::stark::config::{CurtaConfig, StarkyConfig};
use crate::plonky2::stark::proof::StarkProofTarget;
use crate::plonky2::stark::prover::StarkyProver;
use crate::plonky2::stark::verifier::set_stark_proof_target;
use crate::plonky2::stark::Starky;
use crate::utils::serde::{BufferRead, BufferWrite};

#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
Expand Down Expand Up @@ -80,8 +80,12 @@ impl<F: PrimeField64, E: CubicParameters<F>, C, const D: usize> SHA256Generator<
}
}

impl<F: RichField + Extendable<D>, C: CurtaConfig<D, F =F>, E: CubicParameters<F>, const D: usize> SimpleGenerator<F, D>
for SHA256Generator<F, E, C, D>
impl<
F: RichField + Extendable<D>,
C: CurtaConfig<D, F = F>,
E: CubicParameters<F>,
const D: usize,
> SimpleGenerator<F, D> for SHA256Generator<F, E, C, D>
{
fn id(&self) -> String {
Self::id()
Expand Down Expand Up @@ -161,15 +165,11 @@ impl<F: RichField + Extendable<D>, C: CurtaConfig<D, F =F>, E: CubicParameters<F
self.pub_values_target
.set_targets(sha_public_values, out_buffer);

let public_inputs : Vec<_> = writer.public.read().unwrap().clone();
let public_inputs: Vec<_> = writer.public.read().unwrap().clone();

let proof = StarkyProver::<F, C, D>::prove(
&config,
&stark,
&trace_generator,
&public_inputs,
)
.unwrap();
let proof =
StarkyProver::<F, C, D>::prove(&config, &stark, &trace_generator, &public_inputs)
.unwrap();

set_stark_proof_target(out_buffer, &self.proof_target, &proof);

Expand Down
2 changes: 1 addition & 1 deletion curta/src/plonky2/stark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ pub(crate) mod tests {
use plonky2::util::timing::TimingTree;
use serde::de::DeserializeOwned;

use super::*;
use super::generator::simple::SimpleStarkWitnessGenerator;
use super::*;
use crate::air::fibonacci::FibonacciAir;
use crate::chip::builder::tests::ArithmeticGenerator;
use crate::chip::{AirParameters, Chip};
Expand Down

0 comments on commit a65c049

Please sign in to comment.