Fix to delta table for private/public SunJCE RSA test

pull/95/head
Jack Tjaden 2025-01-31 17:14:49 -07:00
parent 6f87879760
commit 4839bcca32
1 changed files with 33 additions and 13 deletions

View File

@ -119,6 +119,17 @@ public class CryptoBenchmark {
provider = providerEntry.getKey();
if (!provider.equals("wolfJCE")) {
otherSpeed = providerEntry.getValue();
/* Adjust provider name for RSA operations */
String displayProvider = provider;
if (isRSAOperation) {
if (operation.contains("key gen")) {
displayProvider = "SunRsaSign"; // Key generation uses SunRsaSign
} else {
displayProvider = "SunJCE"; // Public/private operations use SunJCE
}
}
if (isRSAOperation) {
deltaValue = wolfSpeed - otherSpeed;
deltaPercent = ((wolfSpeed / otherSpeed) - 1.0) * 100;
@ -126,11 +137,19 @@ public class CryptoBenchmark {
deltaValue = wolfSpeed - otherSpeed;
deltaPercent = ((wolfSpeed / otherSpeed) - 1.0) * 100;
}
/* Ensure unique operation-provider combination */
String uniqueKey = operation + "|" + displayProvider;
if (!groupedResults.containsKey(uniqueKey)) {
System.out.printf("| %-40s | %-12s | %+8.2f | %+8.1f |%n",
operation.replace("RSA", "RSA/ECB/PKCS1Padding RSA"),
provider,
displayProvider,
deltaValue,
deltaPercent);
/* Mark this combination as processed */
groupedResults.put(uniqueKey, null);
}
}
}
}
@ -138,6 +157,7 @@ public class CryptoBenchmark {
System.out.println("* Delta Value: MiB/s for symmetric ciphers, operations/second for RSA");
}
/* Run symmetric encryption/decryption benchmarks */
private static void runEncDecBenchmark(String algorithm, String mode, String padding,
String providerName) throws Exception {
SecretKey key;