Skip to content

Commit 98e85c9

Browse files
author
Jack Tjaden
committed
Changed fixed length key sizes to match test.c for HMAC test
1 parent e8c10e4 commit 98e85c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/provider/CryptoBenchmark.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ private static byte[] generateTestData(int size) {
7474
return new byte[size];
7575
}
7676

77+
/* Bytes sizes from WC_*_DIGEST_SIZE for corresponding algorithm in text.c */
7778
private static int getHmacKeySize(String algorithm) {
78-
// Key sizes in bytes based on hash block sizes
7979
switch (algorithm) {
8080
case "HmacMD5":
81-
return 64;
81+
return 16;
8282
case "HmacSHA1":
83-
return 64;
83+
return 20;
8484
case "HmacSHA256":
85-
return 64;
85+
return 32;
8686
case "HmacSHA384":
87-
return 128;
87+
return 48;
8888
case "HmacSHA512":
89-
return 128;
89+
return 64;
9090
default:
9191
throw new IllegalArgumentException("Unsupported HMAC algorithm: " + algorithm);
9292
}
@@ -176,7 +176,7 @@ private static void printDeltaTable() {
176176
}
177177
}
178178
System.out.println("--------------------------------------------------------------------------------");
179-
System.out.println("* Delta Value: MiB/s for symmetric ciphers, operations/second for RSA");
179+
System.out.println("* Delta Value: MiB/s for symmetric ciphers, operations/second for RSA and ECC");
180180
}
181181

182182
/* Run symmetric encryption/decryption benchmarks */

0 commit comments

Comments
 (0)