Skip to content
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

JCE: Implements RSA key gen benchmark #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jackctj117
Copy link

Added RSA key gen for WolfJCE and BC benchmarks.

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.

Please see comments. Let's also add SunJCE RSA benchmarks as part of this PR.

examples/provider/CryptoBenchmark.java Outdated Show resolved Hide resolved
/* Run RSA benchmarks */
private static void runRSABenchmark(String providerName, int keySize) throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA", providerName);
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding", providerName);
Copy link
Member

Choose a reason for hiding this comment

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

I don't see the RSA mode printed in the output (RSA/ECB/PKCS1Padding). Please add this, as different RSA modes will have different performance.

Copy link
Member

Choose a reason for hiding this comment

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

This is almost there. Thanks for printing the mode to the performance delta table. We should also print the mode when benchmarking the operations and printing out those values, ie in this section:

RSA Benchmark Results
-----------------------------------------------------------------------------

wolfJCE:
RSA 2048 key gen                  7 ops took 1.186 sec, avg 169.408 ms, 5.903 ops/sec
RSA 2048 public              18375 ops took 1.000 sec, avg 0.054 ms, 18374.214 ops/sec
RSA 2048 private                395 ops took 1.001 sec, avg 2.535 ms, 394.451 ops/sec
RSA 3072 key gen                  1 ops took 1.014 sec, avg 1014.378 ms, 0.986 ops/sec
RSA 4096 key gen                  1 ops took 3.252 sec, avg 3251.564 ms, 0.308 ops/sec

BC:
RSA 2048 key gen                  6 ops took 1.016 sec, avg 169.387 ms, 5.904 ops/sec
RSA 2048 public              20134 ops took 1.000 sec, avg 0.050 ms, 20133.041 ops/sec
RSA 2048 private                707 ops took 1.001 sec, avg 1.415 ms, 706.634 ops/sec
RSA 3072 key gen                  1 ops took 1.028 sec, avg 1028.333 ms, 0.972 ops/sec
RSA 4096 key gen                  1 ops took 1.762 sec, avg 1761.963 ms, 0.568 ops/sec
-----------------------------------------------------------------------------

examples/provider/CryptoBenchmark.java Outdated Show resolved Hide resolved
examples/provider/CryptoBenchmark.java Outdated Show resolved Hide resolved
examples/provider/CryptoBenchmark.java Outdated Show resolved Hide resolved
System.out.println("-----------------------------------------------------------------------------");

/* Run RSA benchmarks */
System.out.println("\nRSA Benchmark Results");
Copy link
Member

Choose a reason for hiding this comment

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

Was it intentional to not have the RSA benchmarks be formatted as a table, like the AES/symmetric ones are above? I'm ok either way, but we should be consistent - either all benchmarks should be printed as tables, or all benchmarks should be printed without tables (text lines only).

@cconlon cconlon removed their assignment Jan 24, 2025
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.

3 participants