Skip to content

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Nov 12, 2025

This PR includes fixes to speed up performance of some of the JUnit tests:

  • Eliminate redundant DER export in WolfCryptRSAKeyFactory.generatePublicFromX509()
  • Reduce wolfjce.wks.iterationCount to 10,000 in WolfCryptUtilTest to reduce test time
  • Reduce numThreads and iterationsPerThread in WolfSSLKeyStoreTest to reduce test time
  • Optimize WolfCryptSignatureTest, WolfCryptCipherTest, and `WolfCryptSignatureP1363Test to pre-generate and share keys to speed up test time

@cconlon cconlon self-assigned this Nov 12, 2025
@cconlon cconlon requested a review from Copilot November 12, 2025 17:20
Copilot finished reviewing on behalf of cconlon November 12, 2025 17:23
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 implements performance improvements for JUnit tests by eliminating redundant operations and pre-generating expensive cryptographic keys. The changes significantly reduce test execution time while maintaining test coverage and correctness.

Key changes include:

  • Pre-generation and reuse of RSA and ECC key pairs across signature and cipher tests to avoid expensive per-test key generation
  • Reduction of PBKDF2 iteration count from 210,000 to 10,000 in WolfCryptUtilTest for faster test execution
  • Elimination of redundant DER export operation in WolfCryptRSAKeyFactory.generatePublicFromX509()

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
WolfSSLKeyStoreTest.java Reduced thread count from 15 to 5 and iterations per thread from 100 to 10 for faster concurrent test execution
WolfCryptUtilTest.java Added setup/teardown logic to temporarily reduce PBKDF2 iteration count during tests
WolfCryptSignatureTest.java Implemented pre-generation of RSA-2048 and ECC-521 key pairs in @BeforeClass to eliminate redundant key generation across 15+ test methods
WolfCryptSignatureP1363Test.java Pre-generated key pairs for all enabled ECC curves in @BeforeClass and reused across P1363 signature format tests
WolfCryptCipherTest.java Pre-generated RSA-2048 key pair in @BeforeClass for reuse across RSA encryption/decryption tests
WolfCryptRSAKeyFactory.java Removed redundant DER export/import cycle, directly using validated X.509 DER for public key creation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cconlon cconlon assigned rlm2002 and unassigned cconlon Nov 12, 2025
@rlm2002 rlm2002 merged commit 4cfd112 into wolfSSL:master Nov 12, 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