Repository navigation
Conversation
In many cases properties of the parameters were checked 2 or 3 times...
There was a problem hiding this comment.
🔵 Needs a closer look
Cryptographic assurance review is warranted because strong group verification now relies on construction-time Baillie–PSW checks for external groups instead of randomized Miller–Rabin/Lucas tests with a 128-bit error target.
No open issues 🎉
What changed in this PR
This PR reduces repeated elliptic-curve parameter validation by relying on checks performed when EC_Group instances are created.
Changes:
- Removes duplicate generator checks from internal group construction and the generic curve backend.
- Simplifies
verify_group()while retaining legacy-specific checks, and documents the validation assumptions. - Adds a regression test confirming custom-group registration rejects an off-curve generator.
| File | Description |
|---|---|
src/tests/test_ec_group.cpp |
Tests rejection of an off-curve generator during custom-group registration. |
src/lib/pubkey/ec_group/ec_inner_data.h |
Documents the constructor’s reliance on trusted or previously validated parameters. |
src/lib/pubkey/ec_group/ec_inner_data.cpp |
Removes redundant generator validation and makes the Barrett include legacy-only. |
src/lib/pubkey/ec_group/ec_group.h |
Documents reduced validation and unused verify_group() arguments. |
src/lib/pubkey/ec_group/ec_group.cpp |
Removes repeated domain checks from verify_group(), retaining legacy-specific checks. |
src/lib/math/pcurves/pcurves_generic/pcurves_generic.cpp |
Removes duplicate generator validation and documents reliance on EC_Group checks. |
Review effort: Balanced
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In many cases properties of the parameters were checked 2 or 3 times...