fix wp_ecx_get_security_bits to return the correct security bits for x448 and x25519#417
Open
gasbytes wants to merge 1 commit into
Open
fix wp_ecx_get_security_bits to return the correct security bits for x448 and x25519#417gasbytes wants to merge 1 commit into
gasbytes wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the ECX key-management security-bits calculation so the provider reports correct EVP_PKEY_get_security_bits() values for X25519 (128) and X448 (224), and adds a unit test to prevent regressions.
Changes:
- Adjust
wp_ecx_get_security_bits()thresholds to correctly map X448 and X25519 bit sizes to their security-bit strengths. - Add a new ECX unit test that generates X25519/X448 keys with OpenSSL and wolfProvider and compares reported security bits.
- Register the new test in the unit test declarations and test-case table.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/wp_ecx_kmgmt.c |
Fixes security-bits threshold logic so X448 (448) and X25519 (255) return correct strengths. |
test/test_ecx.c |
Adds a new test to validate security bits for X25519/X448 via generated keys. |
test/unit.c |
Registers the new test in the unit test runner. |
test/unit.h |
Declares the new test function behind the relevant feature guards. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9c02936 to
6d9a812
Compare
ColtonWilley
left a comment
Contributor
There was a problem hiding this comment.
Skoll Code Review
Scan type: reviewOverall recommendation: REQUEST_CHANGES
Findings: 3 total — 3 posted, 0 skipped
3 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [High] New test uses ARRAY_SIZE outside its defining feature guard — compile break in curve-only builds —
test/test_ecx.c:926 - [Medium] Security-bits test only checks parity with OpenSSL, not the expected absolute values —
test/test_ecx.c:951-958 - [Low] Magic-number thresholds in wp_ecx_get_security_bits are undocumented —
src/wp_ecx_kmgmt.c:514-518
Review generated by Skoll
6d9a812 to
3b27018
Compare
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.
fix wp_ecx_get_security_bits threasholds so x25519 returns 128 and x448 returns 224