-
Notifications
You must be signed in to change notification settings - Fork 16
RSA KeyFactory and JUnit Test Performance Improvements #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ePublicFromX509()
There was a problem hiding this 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.
src/test/java/com/wolfssl/provider/jce/test/WolfCryptSignatureP1363Test.java
Outdated
Show resolved
Hide resolved
…Test to reduce test time
…Test to reduce test time
… RSA and ECDSA to share across signature test methods
… to pre-generate keys to speed up test execution
1d8efdf to
a28c0f4
Compare
This PR includes fixes to speed up performance of some of the JUnit tests:
WolfCryptRSAKeyFactory.generatePublicFromX509()wolfjce.wks.iterationCountto 10,000 inWolfCryptUtilTestto reduce test timenumThreadsanditerationsPerThreadinWolfSSLKeyStoreTestto reduce test timeWolfCryptSignatureTest,WolfCryptCipherTest, and `WolfCryptSignatureP1363Test to pre-generate and share keys to speed up test time