Merge expanding and checking Hmac functions to avoid re-creating the Mac instance.

This commit is contained in:
Vitor Pamplona
2025-09-15 17:25:36 -04:00
parent e329b096ba
commit cd0b1b65fb
3 changed files with 36 additions and 6 deletions
@@ -46,7 +46,15 @@ class HkdfBenchmark {
}
@Test
fun hkdfExpand() {
fun hkdfExpandWithCheck() {
val hkdf = Hkdf()
benchmarkRule.measureRepeated {
hkdf.fastExpand(sharedKey, encrypted.nonce, encrypted.ciphertext, encrypted.mac)
}
}
@Test
fun hkdfFastExpand() {
val hkdf = Hkdf()
benchmarkRule.measureRepeated {
hkdf.fastExpand(sharedKey, encrypted.nonce)