Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix small_fib example for indices of 2^x #748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ph4r05
Copy link

@ph4r05 ph4r05 commented Jul 15, 2021

This PR fixes small_fib example for indices of format 2^x.

When testing claims with index: 2^x, x >=1, value 1 passes the proof verification. I think the reason is how the trace is constructed.

Trace length is defined as power of two:

let trace_length = self.index.next_power_of_two();

But if self.index is already power of two, trace_length == self.index. It can be a bit misleading that next keyword returns greater or equal power of two

Thus if I change it to

let trace_length = (self.index + 1).next_power_of_two();

all indices work fine now.

  • Tag the PR with wip while in development.
  • Assign yourself as to the PR
  • Assign relevant labels such as bug, enhancement.
  • Request reviews if the PR is large, complex or you would like an extra pair of eyes to go over it.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the Changelog.md.
  • Update version numbers as needed.

https://semver.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants