Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

fix small_fib example for indices of 2^x #748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crypto/stark/examples/small_fib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Verifiable for Claim {
seed.extend_from_slice(&self.value.as_montgomery().to_bytes_be());

// Constraint repetitions
let trace_length = self.index.next_power_of_two();
let trace_length = (self.index + 1).next_power_of_two();
let trace_generator = FieldElement::root(trace_length).unwrap();
let g = Constant(trace_generator);
let on_row = |index| (X - g.pow(index)).inv();
Expand All @@ -44,7 +44,7 @@ impl Verifiable for Claim {

impl Provable<&Witness> for Claim {
fn trace(&self, witness: &Witness) -> TraceTable {
let trace_length = self.index.next_power_of_two();
let trace_length = (self.index + 1).next_power_of_two();
let mut trace = TraceTable::new(trace_length, 2);
trace[(0, 0)] = 1.into();
trace[(0, 1)] = witness.secret.clone();
Expand Down