fix wp_ecx_get_security_bits to return the correct security bits for x448 and x25519#417
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
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
aidangarske
left a comment
There was a problem hiding this comment.
🐺 Skoll Code Review
Overall recommendation: REQUEST_CHANGES
Findings: 1 total — 1 posted, 0 skipped
Posted findings
- [High] ED448-only test build now reaches undeclared provider_name —
test/test_ecx.c:33
Review generated by Skoll.
3b27018 to
4899f7f
Compare
fix wp_ecx_get_security_bits threasholds so x25519 returns 128 and x448 returns 224