Skip to content

Commit

Permalink
minor comment and naming updates
Browse files Browse the repository at this point in the history
  • Loading branch information
irakliyk committed Feb 9, 2025
1 parent d380a13 commit 30c5053
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 69 deletions.
5 changes: 3 additions & 2 deletions air/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ impl ProofOptions {
}

impl<E: StarkField> ToElements<E> for ProofOptions {
/// Encodes these proof options into 3 field elements.
fn to_elements(&self) -> Vec<E> {
// encode field extension and FRI parameters into a single field element
// encode field extension, FRI parameters, and blowup factor into a single field element
let mut buf = self.field_extension as u32;
buf = (buf << 8) | self.fri_folding_factor as u32;
buf = (buf << 8) | self.fri_remainder_max_degree as u32;
Expand Down Expand Up @@ -592,7 +593,7 @@ mod tests {
fri_folding_factor as usize,
fri_remainder_max_degree as usize,
BatchingMethod::Linear,
BatchingMethod::Linear,
BatchingMethod::Algebraic,
);

let options_serialized = options.to_bytes();
Expand Down
14 changes: 9 additions & 5 deletions air/src/proof/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,16 @@ impl<E: StarkField> ToElements<E> for Context {
/// Converts this [Context] into a vector of field elements.
///
/// The elements are laid out as follows:
/// - trace info [2 or more elements].
/// - trace info:
/// - trace segment widths and the number of aux random values [1 element].
/// - trace length [1 element].
/// - trace metadata [0 or more elements].
/// - field modulus bytes [2 field elements].
/// - field extension and FRI parameters [1 element].
/// - grinding factor [1 element].
/// - blowup factor [1 element].
/// - number of queries [1 element].
/// - number of constraints (1 element).
/// - proof options:
/// - field extension, FRI parameters, and grinding factor [1 element].
/// - blowup factor [1 element].
/// - number of queries [1 element].
fn to_elements(&self) -> Vec<E> {
// convert trace layout
let mut result = self.trace_info.to_elements();
Expand Down
4 changes: 2 additions & 2 deletions air/src/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ impl Proof {
// polynomials.
let num_trace_polys = self.context.trace_info().width();
let num_constraint_composition_polys = self.options().blowup_factor();
let num_polys = num_trace_polys + num_constraint_composition_polys;
let num_committed_polys = num_trace_polys + num_constraint_composition_polys;
ProvenSecurity::compute(
self.context.options(),
self.context.num_modulus_bits(),
self.trace_info().length(),
H::COLLISION_RESISTANCE,
num_constraints,
num_polys,
num_committed_polys,
)
}

Expand Down
Loading

0 comments on commit 30c5053

Please sign in to comment.