Skip to content

Commit

Permalink
Changed fixed length key sizes to match test.c for HMAC test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Tjaden committed Feb 14, 2025
1 parent e8c10e4 commit 98e85c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/provider/CryptoBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ private static byte[] generateTestData(int size) {
return new byte[size];
}

/* Bytes sizes from WC_*_DIGEST_SIZE for corresponding algorithm in text.c */
private static int getHmacKeySize(String algorithm) {
// Key sizes in bytes based on hash block sizes
switch (algorithm) {
case "HmacMD5":
return 64;
return 16;
case "HmacSHA1":
return 64;
return 20;
case "HmacSHA256":
return 64;
return 32;
case "HmacSHA384":
return 128;
return 48;
case "HmacSHA512":
return 128;
return 64;
default:
throw new IllegalArgumentException("Unsupported HMAC algorithm: " + algorithm);
}
Expand Down Expand Up @@ -176,7 +176,7 @@ private static void printDeltaTable() {
}
}
System.out.println("--------------------------------------------------------------------------------");
System.out.println("* Delta Value: MiB/s for symmetric ciphers, operations/second for RSA");
System.out.println("* Delta Value: MiB/s for symmetric ciphers, operations/second for RSA and ECC");
}

/* Run symmetric encryption/decryption benchmarks */
Expand Down

0 comments on commit 98e85c9

Please sign in to comment.