Skip to content

Comments

JCE: Add P1363 ECDSA signature formats, fix parameter handling, and improve ECC defaults#160

Merged
rlm2002 merged 8 commits intowolfSSL:masterfrom
cconlon:ecParamFix
Sep 26, 2025
Merged

JCE: Add P1363 ECDSA signature formats, fix parameter handling, and improve ECC defaults#160
rlm2002 merged 8 commits intowolfSSL:masterfrom
cconlon:ecParamFix

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Sep 24, 2025

This PR includes the following changes to JCE Signature and ECC functionality:

  • Fix ECDSA signature parameter handling and secp521r1 curve recognition
  • Add support for IEEE P1363 format ECDSA signatures, specifically SHA256withECDSAinP1363Format, SHA384withECDSAinP1363Format, SHA512withECDSAinP1363Format, SHA3-256withECDSAinP1363Format, SHA3-384withECDSAinP1363Format, and SHA3-512withECDSAinP1363Format.
  • Add default 256-bit key size for ECC KeyPairGenerator

This includes JUnit tests for regression prevention and fixes running against several of the OpenJDK SunJCE ECDSA tests.

@cconlon cconlon self-assigned this Sep 24, 2025
@cconlon cconlon requested a review from Copilot September 24, 2025 22:36
Copy link

Copilot AI left a comment

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 enhances the wolfJCE provider with IEEE P1363 ECDSA signature format support and improves ECC parameter handling. The changes fix several issues with ECDSA signature parameter validation and add comprehensive P1363 format signature support across multiple hash algorithms.

Key changes include:

  • Added support for six new IEEE P1363 format ECDSA signature algorithms (SHA256/384/512 and SHA3-256/384/512 with ECDSA in P1363 format)
  • Fixed secp521r1 curve recognition by adjusting field size calculation for proper wolfCrypt parameter matching
  • Added default 256-bit key size for ECC KeyPairGenerator to enable generation without explicit initialization

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WolfCryptSignature.java Added P1363 format conversion logic and six new signature algorithm implementations
WolfCryptProvider.java Registered P1363 format signature algorithms with the JCE provider
Ecc.java Enhanced curve recognition with adjusted field size calculation and added P1363 conversion methods
WolfCryptKeyPairGenerator.java Added default 256-bit ECC key size initialization
WolfCryptSignatureP1363Test.java New comprehensive test suite for P1363 signature format validation
WolfCryptSignatureTest.java Added regression tests for ECDSA parameter handling
EccTest.java Added test for secp521r1 curve recognition
jni_ecc.c Implemented native JNI methods for P1363 signature format conversion
Comments suppressed due to low confidence (2)

src/test/java/com/wolfssl/provider/jce/test/WolfCryptSignatureP1363Test.java:1

  • The comment style is inconsistent with Java conventions. Use // for single-line comments instead of /* */ to maintain consistency with the rest of the codebase.
/* WolfCryptSignatureP1363Test.java

src/test/java/com/wolfssl/provider/jce/test/WolfCryptSignatureP1363Test.java:1

  • The comment style is inconsistent with Java conventions. Use // for multi-line comments instead of /* */ to maintain consistency with the rest of the codebase.
/* WolfCryptSignatureP1363Test.java

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cconlon cconlon assigned rlm2002 and unassigned cconlon Sep 25, 2025
@rlm2002 rlm2002 merged commit a64bbc4 into wolfSSL:master Sep 26, 2025
46 checks passed
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