Skip to content

Implement HMAC-SHA3 benchmarks (224/256/384/512) - #501

Open
kojiws wants to merge 1 commit into
wolfSSL:mainfrom
kojiws:fix_hmac_sha3_benchmark
Open

Implement HMAC-SHA3 benchmarks (224/256/384/512)#501
kojiws wants to merge 1 commit into
wolfSSL:mainfrom
kojiws:fix_hmac_sha3_benchmark

Conversation

@kojiws

@kojiws kojiws commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the HMAC-SHA3 benchmarks in
benchmark/bench_modules/wh_bench_mod_hmac.c, which were stubs returning
WH_ERROR_NOTIMPL and silently -> SKIPPED. Covers all four variants
(224/256/384/512), DMA and non-DMA. Entries switched from
BENCH_THROUGHPUT_NONE to XBPS so throughput is reported.

wolfHSM has no HMAC server handler, so the ipad/opad construction runs
client-side; only the inner SHA3 compressions are offloaded. Same as the
existing HMAC-SHA2-256 benchmark — the number is HMAC as seen by the client.

Test

make DMA=1: all eight rows report; previously two were SKIPPED and six
did not exist. make (non-DMA): the four non-DMA rows report. Building with
WOLFSSL_NOSHA3_224/_384 drops those variants cleanly.

Offload confirmed with DEBUG_VERBOSE=1: 500 SHA3 requests per 100
iterations, consistent with two inner hashes per HMAC. Throughput tracks the
Keccak rate within 3%; the residual is the fixed ipad/opad cost.

Not verified: digest correctness. Unlike SHA3, the repository has no HMAC
test coverage at all, so nothing backs these values beyond the SHA3 KATs
covering the inner hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant