Skip to content

Conversation

@jackctj117
Copy link
Contributor

@jackctj117 jackctj117 commented Jun 9, 2025

Added KeyGen benchmark and some code cleanup.

@jackctj117 jackctj117 self-assigned this Jun 9, 2025
@jackctj117 jackctj117 requested a review from Copilot June 9, 2025 19:00

This comment was marked as outdated.

@jackctj117 jackctj117 requested a review from Copilot June 9, 2025 19:02

This comment was marked as outdated.

This comment was marked as outdated.

@jackctj117 jackctj117 assigned jackctj117 and unassigned cconlon and jackctj117 Jun 9, 2025
@jackctj117 jackctj117 requested a review from Copilot June 9, 2025 22:15
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 adds a new KeyGenerator benchmarking feature and updates the algorithm filtering logic for providers, along with some code cleanup.

  • Extends getAlgorithmsForProvider to treat KeyGenerator alongside Mac
  • Implements runKeyGeneratorBenchmark and related helper methods
  • Updates main to execute the KeyGenerator benchmarks for each provider
Comments suppressed due to low confidence (2)

examples/provider/CryptoBenchmark.java:1292

  • New benchmarking logic should be covered by unit or integration tests to ensure consistent behavior and prevent regressions.
private static void runKeyGeneratorBenchmark(String algorithm, String providerName) throws Exception {

examples/provider/CryptoBenchmark.java:1294

  • [nitpick] The variable name ops is ambiguous; consider renaming it to something more descriptive like operationCount.
int ops = 0;

Copy link
Member

@cconlon cconlon left a comment

Choose a reason for hiding this comment

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

Seems like something goes wrong for me when I run this:

-----------------------------------------------------------------------------
KeyGenerator Benchmark Results
-----------------------------------------------------------------------------

wolfJCE:
 AES (wolfJCE)                               727628 ops took 1.000 sec, 727627.366 ops/sec
 HmacSHA1 (wolfJCE)                        Error: Unsupported algorithm: HmacSHA1
 HmacSHA224 (wolfJCE)                      Error: Unsupported algorithm: HmacSHA224
 HmacSHA256 (wolfJCE)                      Error: Unsupported algorithm: HmacSHA256
 HmacSHA384 (wolfJCE)                      Error: Unsupported algorithm: HmacSHA384
 HmacSHA512 (wolfJCE)                      Error: Unsupported algorithm: HmacSHA512

SunJCE:
 AES (SunJCE)                                770843 ops took 1.000 sec, 770842.320 ops/sec
 HmacSHA1 (SunJCE)                         Error: Unsupported algorithm: HmacSHA1
 HmacSHA224 (SunJCE)                       Error: Unsupported algorithm: HmacSHA224
 HmacSHA256 (SunJCE)                       Error: Unsupported algorithm: HmacSHA256
 HmacSHA384 (SunJCE)                       Error: Unsupported algorithm: HmacSHA384
 HmacSHA512 (SunJCE)                       Error: Unsupported algorithm: HmacSHA512

BC:
 AES (BC)                                    779577 ops took 1.000 sec, 779576.505 ops/sec
 HMACSHA1 (BC)                             Error: Unsupported algorithm: HMACSHA1
 HMACSHA224 (BC)                           Error: Unsupported algorithm: HMACSHA224
 HMACSHA256 (BC)                           Error: Unsupported algorithm: HMACSHA256
 HMACSHA384 (BC)                           Error: Unsupported algorithm: HMACSHA384
 HMACSHA512 (BC)                           Error: Unsupported algorithm: HMACSHA512

My Java version:

java -version
openjdk version "1.8.0_372"
OpenJDK Runtime Environment Corretto-8.372.07.1 (build 1.8.0_372-b07)
OpenJDK 64-Bit Server VM Corretto-8.372.07.1 (build 25.372-b07, mixed mode)

Also, please squash commits down, thanks.

@cconlon cconlon removed their assignment Jun 10, 2025
@cconlon cconlon changed the title JCE: Implements KeyGen benchmark JCE: Implements KeyGenerator benchmark Jun 10, 2025
@jackctj117 jackctj117 force-pushed the KeyGen-benchmark branch 3 times, most recently from 8e31e2b to f882b2e Compare June 10, 2025 16:33
@cconlon cconlon merged commit 7ab0ddd into wolfSSL:master Jun 10, 2025
41 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