Skip to content

Commit

Permalink
Pass log blowup factor to commitment scheme. (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonh5 authored Mar 4, 2024
1 parent 22628f7 commit feb67fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/core/commitment_scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ pub struct CommitmentSchemeProver<F: ExtensionOf<BaseField>> {
impl<F: ExtensionOf<BaseField>> CommitmentSchemeProver<F> {
pub fn new(
polynomials: Vec<CPUCirclePoly<F>>,
domains: Vec<CanonicCoset>,
log_blowup_factor: u32,
channel: &mut Blake2sChannel,
) -> Self {
assert_eq!(polynomials.len(), domains.len(),);
let domains = polynomials
.iter()
.map(|poly| CanonicCoset::new(poly.log_size() + log_blowup_factor))
.collect_vec();
let evaluations = zip(&polynomials, domains)
.map(|(poly, domain)| poly.evaluate(domain.circle_domain()).bit_reverse())
.collect_vec();
Expand Down
10 changes: 3 additions & 7 deletions src/fibonacci/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use self::component::FibonacciComponent;
use crate::commitment_scheme::blake2_hash::Blake2sHasher;
use crate::commitment_scheme::hasher::Hasher;
use crate::commitment_scheme::merkle_decommitment::MerkleDecommitment;
use crate::core::air::evaluation::SECURE_EXTENSION_DEGREE;
use crate::core::air::{AirExt, ComponentTrace};
use crate::core::backend::CPUBackend;
use crate::core::channel::{Blake2sChannel, Channel as ChannelTrait};
Expand Down Expand Up @@ -103,11 +102,8 @@ impl Fibonacci {
// Evaluate and commit on trace.
let trace = self.get_trace();
let trace_poly = trace.interpolate();
let trace_commitment_scheme = CommitmentSchemeProver::new(
vec![trace_poly],
vec![self.trace_commitment_domain],
channel,
);
let trace_commitment_scheme =
CommitmentSchemeProver::new(vec![trace_poly], LOG_BLOWUP_FACTOR, channel);

// Evaluate and commit on composition polynomial.
let random_coeff = channel.draw_felt();
Expand All @@ -118,7 +114,7 @@ impl Fibonacci {
.compute_composition_polynomial(random_coeff, &component_traces);
let composition_polynomial_commitment_scheme = CommitmentSchemeProver::new(
composition_polynomial_poly.to_vec(),
[self.composition_polynomial_commitment_domain; SECURE_EXTENSION_DEGREE].to_vec(),
LOG_BLOWUP_FACTOR,
channel,
);

Expand Down

0 comments on commit feb67fe

Please sign in to comment.