Skip to content

Commit

Permalink
Remove obsolete method for computing unit_distance (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Sep 20, 2022
1 parent c539ca1 commit cd1c8e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
11 changes: 5 additions & 6 deletions triton-vm/src/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ use crate::cross_table_arguments::{
use crate::fri_domain::FriDomain;
use crate::proof_item::ProofItem;
use crate::table::challenges_endpoints::{AllChallenges, AllInitials};
use crate::table::table_collection::{
derive_omicron, unit_distance, BaseTableCollection, ExtTableCollection,
};
use crate::table::table_collection::{derive_omicron, BaseTableCollection, ExtTableCollection};
use crate::triton_xfri::{self, Fri};

use super::table::base_matrix::BaseMatrices;
Expand Down Expand Up @@ -269,8 +267,9 @@ impl Stark {
}
timer.elapsed("fri.prove");

// the relation between the FRI domain and the omicron domain
let unit_distance = self.xfri.domain.length / base_tables.padded_height;
// Open leafs of zipped codewords at indicated positions
let unit_distance = unit_distance(base_tables.padded_height, self.xfri.domain.length);
let revealed_indices =
self.get_revealed_indices(unit_distance, &cross_codeword_slice_indices);

Expand Down Expand Up @@ -683,9 +682,9 @@ impl Stark {
self.xfri.verify(proof_stream, &combination_root)?;
timer.elapsed("Verified FRI proof");

// the relation between the FRI domain and the omicron domain
let unit_distance = self.xfri.domain.length / ext_table_collection.padded_height;
// Open leafs of zipped codewords at indicated positions
let unit_distance =
unit_distance(ext_table_collection.padded_height, self.xfri.domain.length);
let revealed_indices = self.get_revealed_indices(unit_distance, &combination_check_indices);
timer.elapsed("Calculated revealed indices");

Expand Down
5 changes: 3 additions & 2 deletions triton-vm/src/table/extension_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use twenty_first::timing_reporter::TimingReporter;
use crate::fri_domain::FriDomain;
use crate::stark::{Stark, StarkHasher};
use crate::table::challenges_endpoints::AllTerminals;
use crate::table::table_collection::{interpolant_degree, unit_distance};
use crate::table::table_collection::interpolant_degree;

use super::base_table::TableLike;
use super::challenges_endpoints::AllChallenges;
Expand Down Expand Up @@ -264,7 +264,8 @@ pub trait Quotientable: ExtensionTable + Evaluable {
.zip_eq(subgroup_zerofier_inverse.into_par_iter())
.map(|(fri_dom_v, sub_z_inv)| (fri_dom_v - omicron_inverse) * sub_z_inv)
.collect();
let unit_distance = unit_distance(padded_height, fri_domain.length);
// the relation between the FRI domain and the omicron domain
let unit_distance = fri_domain.length / padded_height;

let transposed_quotient_codewords: Vec<_> = zerofier_inverse
.par_iter()
Expand Down
9 changes: 0 additions & 9 deletions triton-vm/src/table/table_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ pub fn derive_omicron<DataPF: FiniteField>(padded_height: u64) -> DataPF {
DataPF::primitive_root_of_unity(padded_height).unwrap()
}

/// Returns the relation between the FRI domain and the omicron domain
pub fn unit_distance(padded_height: usize, omega_order: usize) -> usize {
if padded_height == 0 {
0
} else {
omega_order / padded_height
}
}

impl BaseTableCollection {
pub fn from_base_matrices(base_matrices: &BaseMatrices) -> Self {
let padded_height = Self::padded_height(base_matrices);
Expand Down

0 comments on commit cd1c8e9

Please sign in to comment.