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: Fix barrett reduction bug #51

Merged
merged 6 commits into from
Nov 6, 2024
Merged

fix: Fix barrett reduction bug #51

merged 6 commits into from
Nov 6, 2024

Conversation

iAmMichaelConnor
Copy link
Collaborator

Resolves the test failing in noir_rsa. Thanks to Zac for spotting the bug.

cc @kashbrti

@TomAFrench
Copy link
Member

Can you add a test to this repository which checks the behaviour of this?

@iAmMichaelConnor
Copy link
Collaborator Author

Oh good point. I'll use the RSA one.

@iAmMichaelConnor
Copy link
Collaborator Author

iAmMichaelConnor commented Nov 6, 2024

Hmmm... actually, using the RSA one would just bring most of the RSA lib into bignum. I don't know how to distill a test so complex into a smaller test with no dependencies.

@kashbrti
Copy link
Contributor

kashbrti commented Nov 6, 2024

I'm writing a test now that only passes the output that was making the bug happen to a test directly

Copy link
Collaborator Author

@iAmMichaelConnor iAmMichaelConnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Just a couple of nits.
Eventually we'll need detailed tests of each function, if we want this thing to pass an audit.

src/tests/runtime_bignum_test.nr Outdated Show resolved Hide resolved
src/tests/runtime_bignum_test.nr Outdated Show resolved Hide resolved
src/tests/runtime_bignum_test.nr Show resolved Hide resolved
@kashbrti
Copy link
Contributor

kashbrti commented Nov 6, 2024

formatter check is ok on my box but fails on te CI

@iAmMichaelConnor
Copy link
Collaborator Author

Are you using nargo v0.36.0 to format? I think that's the version you need to use, to match the CI tests.

src/tests/runtime_bignum_test.nr Show resolved Hide resolved
src/fns/unconstrained_helpers.nr Show resolved Hide resolved
@TomAFrench TomAFrench merged commit c61a621 into main Nov 6, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Nov 6, 2024
TomAFrench added a commit that referenced this pull request Nov 8, 2024
* main:
  feat: remove generic parameter from the `BigNum` trait (#44)
  fix: fix broken tests in `runtime_bignum_test.nr` (#39)
  feat: remove a bunch of unnecessary bytecode from unconstrained ops (#50)
  fix: Fix barrett reduction bug (#51)
  feat: optimize brillig execution of `split_X_bits` functions (#47)
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.

3 participants