-
Notifications
You must be signed in to change notification settings - Fork 599
chore: Native curve audit #20936
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
Merged
federicobarbacovi
merged 21 commits into
merge-train/barretenberg
from
fb/native_curve_audit
Mar 5, 2026
Merged
chore: Native curve audit #20936
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
21b884d
Improve constant testing + formatting changes
federicobarbacovi dccc281
Improve testing + remove old code about coset generators
federicobarbacovi 65c2bf3
Re order constants
federicobarbacovi 5f46828
Fr
federicobarbacovi 7a1bcf2
Fq (bn254)
federicobarbacovi 72c3dee
Fr tests
federicobarbacovi 76e348b
Move some testing to general field testing; standardise fq/fr testing…
federicobarbacovi 3e3d4d6
Fix python script + Fq2 testing + Fq2 (remove cube root of unity) + M…
federicobarbacovi 8d2c02a
Improve naming
federicobarbacovi 2cd05c8
Fq6
federicobarbacovi 0312cdd
Fq12
federicobarbacovi e7e3ef3
BN254
federicobarbacovi 786a65b
Grumpkin
federicobarbacovi 71f6884
Fixes
federicobarbacovi be7a5d1
Uniform tests for curve field parameters + standardize structure of f…
federicobarbacovi fc0cb57
Final stuff
federicobarbacovi 26773b8
Fixes + add test for generator and coeffs
federicobarbacovi 9857c04
Address comments
federicobarbacovi 3332452
Remove commented out code
federicobarbacovi f18889f
More address comments
federicobarbacovi 3ded1f0
Update header
federicobarbacovi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
barretenberg/cpp/src/barretenberg/ecc/curves/bn254/bn254.test.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * @brief Tests that verify the correctness of BN-254 field constants | ||
| * | ||
| */ | ||
| #include "bn254.hpp" | ||
| #include "barretenberg/numeric/uint256/uint256.hpp" | ||
| #include <array> | ||
| #include <gtest/gtest.h> | ||
|
|
||
| using namespace bb; | ||
|
|
||
| // ================================ | ||
| // BN254 Constants Tests | ||
| // ================================ | ||
|
|
||
| TEST(Bn254Constants, SubgroupGenerator) | ||
| { | ||
| fr subgroup_generator = bb::curve::BN254::subgroup_generator; | ||
| fr subgroup_generator_inverse = bb::curve::BN254::subgroup_generator_inverse; | ||
| fr expected = fr(5).pow((fr::modulus - 1) / (uint256_t(1) << 8)); | ||
| fr expected_inverse = expected.invert(); | ||
|
|
||
| EXPECT_EQ(subgroup_generator, expected); | ||
| EXPECT_EQ(subgroup_generator_inverse, expected_inverse); | ||
| } |
289 changes: 0 additions & 289 deletions
289
barretenberg/cpp/src/barretenberg/ecc/curves/bn254/constants.test.cpp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old issue, closed