From e50d2a9845d6a499b4a7ab32e2f0c9f815dfe1d7 Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Thu, 15 Jul 2021 19:26:24 +0200 Subject: [PATCH] fix small_fib example for indices of 2^x --- crypto/stark/examples/small_fib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/stark/examples/small_fib.rs b/crypto/stark/examples/small_fib.rs index b47c25ad7..832c7b480 100644 --- a/crypto/stark/examples/small_fib.rs +++ b/crypto/stark/examples/small_fib.rs @@ -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(); @@ -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();