Skip to content

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
wolfSSL:masterfrom
gasbytes:wp-ecx-get-security-bits-fix
Draft

fix wp_ecx_get_security_bits to return the correct security bits for x448 and x25519#417
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:wp-ecx-get-security-bits-fix

Conversation

@gasbytes

Copy link
Copy Markdown

fix wp_ecx_get_security_bits threasholds so x25519 returns 128 and x448 returns 224

Copilot AI review requested due to automatic review settings June 29, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread test/test_ecx.c Outdated
Comment thread test/test_ecx.c
@gasbytes gasbytes self-assigned this Jun 29, 2026
@gasbytes gasbytes force-pushed the wp-ecx-get-security-bits-fix branch from 9c02936 to 6d9a812 Compare June 29, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants