-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: master
Are you sure you want to change the base?
Conversation
4f8ad40
to
45f14e5
Compare
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.
Please see comments. Let's also add SunJCE RSA benchmarks as part of this PR.
/* 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); |
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.
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.
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.
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
-----------------------------------------------------------------------------
System.out.println("-----------------------------------------------------------------------------"); | ||
|
||
/* Run RSA benchmarks */ | ||
System.out.println("\nRSA Benchmark Results"); |
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.
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).
Added RSA key gen for WolfJCE and BC benchmarks.