fix wp_ecx_get_security_bits to return the correct security bits for x448 and x25519#417
Draft
gasbytes wants to merge 1 commit into
Draft
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
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