Skip to content

Commit

Permalink
fix(Plonky2x): Vriable -> Variable (#288)
Browse files Browse the repository at this point in the history
Thanks! merging.
  • Loading branch information
npwardberkeley authored Nov 15, 2023
1 parent ae7489c commit dcf82c8
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions plonky2x/core/src/frontend/recursion/fri/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ use crate::prelude::{CircuitBuilder, OutputVariableStream, PlonkParameters, Vari
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FriProofVariable<const D: usize> {
pub commit_phase_merkle_caps: Vec<MerkleCapVariable>,
pub query_round_proofs: Vec<FriQueryRoundVriable<D>>,
pub query_round_proofs: Vec<FriQueryRoundVariable<D>>,
pub final_poly: PolynomialCoeffsExtVariable<D>,
pub pow_witness: Variable,
}

#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FriQueryRoundVriable<const D: usize> {
pub struct FriQueryRoundVariable<const D: usize> {
pub initial_trees_proof: FriInitialTreeProofVariable,
pub steps: Vec<FriQueryStepVariable<D>>,
}
Expand Down Expand Up @@ -83,7 +83,7 @@ impl VariableStream {
&mut self,
num_leaves_per_oracle: &[usize],
params: &FriParams,
) -> FriQueryRoundVriable<D> {
) -> FriQueryRoundVariable<D> {
let cap_height = params.config.cap_height;
assert!(params.lde_bits() >= cap_height);
let mut merkle_proof_len = params.lde_bits() - cap_height;
Expand All @@ -98,7 +98,7 @@ impl VariableStream {
steps.push(self.read_fri_query_step(arity_bits, merkle_proof_len));
}

FriQueryRoundVriable {
FriQueryRoundVariable {
initial_trees_proof,
steps,
}
Expand Down Expand Up @@ -152,7 +152,10 @@ impl VariableStream {
self.write_slice(&coefficients.0)
}

pub fn write_fri_query_round<const D: usize>(&mut self, query_round: &FriQueryRoundVriable<D>) {
pub fn write_fri_query_round<const D: usize>(
&mut self,
query_round: &FriQueryRoundVariable<D>,
) {
self.write_fri_initial_trees_proof(&query_round.initial_trees_proof);

for step in &query_round.steps {
Expand Down Expand Up @@ -221,7 +224,7 @@ impl<L: PlonkParameters<D>, const D: usize> OutputVariableStream<L, D> {
builder: &mut CircuitBuilder<L, D>,
num_leaves_per_oracle: &[usize],
params: &FriParams,
) -> FriQueryRoundVriable<D> {
) -> FriQueryRoundVariable<D> {
let cap_height = params.config.cap_height;
assert!(params.lde_bits() >= cap_height);
let mut merkle_proof_len = params.lde_bits() - cap_height;
Expand All @@ -236,7 +239,7 @@ impl<L: PlonkParameters<D>, const D: usize> OutputVariableStream<L, D> {
steps.push(self.read_fri_query_step(builder, arity_bits, merkle_proof_len));
}

FriQueryRoundVriable {
FriQueryRoundVariable {
initial_trees_proof,
steps,
}
Expand Down Expand Up @@ -485,7 +488,7 @@ impl<const D: usize> From<FriQueryStepTarget<D>> for FriQueryStepVariable<D> {
}
}

impl<const D: usize> From<FriQueryRoundTarget<D>> for FriQueryRoundVriable<D> {
impl<const D: usize> From<FriQueryRoundTarget<D>> for FriQueryRoundVariable<D> {
fn from(value: FriQueryRoundTarget<D>) -> Self {
Self {
initial_trees_proof: value.initial_trees_proof.into(),
Expand All @@ -498,8 +501,8 @@ impl<const D: usize> From<FriQueryRoundTarget<D>> for FriQueryRoundVriable<D> {
}
}

impl<const D: usize> From<FriQueryRoundVriable<D>> for FriQueryRoundTarget<D> {
fn from(value: FriQueryRoundVriable<D>) -> Self {
impl<const D: usize> From<FriQueryRoundVariable<D>> for FriQueryRoundTarget<D> {
fn from(value: FriQueryRoundVariable<D>) -> Self {
Self {
initial_trees_proof: value.initial_trees_proof.into(),
steps: value
Expand All @@ -522,7 +525,7 @@ impl<const D: usize> From<FriProofTarget<D>> for FriProofVariable<D> {
query_round_proofs: value
.query_round_proofs
.into_iter()
.map(FriQueryRoundVriable::from)
.map(FriQueryRoundVariable::from)
.collect(),
final_poly: PolynomialCoeffsExtVariable::from(value.final_poly),
pow_witness: value.pow_witness.into(),
Expand Down

0 comments on commit dcf82c8

Please sign in to comment.