JCE: Add P1363 ECDSA signature formats, fix parameter handling, and improve ECC defaults#160
Conversation
There was a problem hiding this comment.
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.
…d SHA384withECDSAinP1363Format, along with tests
…HA3-256withECDSAinP1363Format, SHA3-384withECDSAinP1363Format, SHA3-512withECDSAinP1363Format, along with tests
There was a problem hiding this comment.
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.
This PR includes the following changes to JCE Signature and ECC functionality:
SHA256withECDSAinP1363Format,SHA384withECDSAinP1363Format,SHA512withECDSAinP1363Format,SHA3-256withECDSAinP1363Format,SHA3-384withECDSAinP1363Format, andSHA3-512withECDSAinP1363Format.This includes JUnit tests for regression prevention and fixes running against several of the OpenJDK SunJCE ECDSA tests.