Fix benchmark guard macros#418
Open
miyazakh wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the preprocessor guard that controls compilation of the ML-DSA 87 benchmark functions so it correctly honors the WOLFSSL_NO_ML_DSA_87 feature-disable macro (consistent with the ML-DSA 44/65 benchmark sections and benchmark/wh_bench.c’s registration guards).
Changes:
- Replace
#if !defined(WOLFSSL_MLDSA_NO_SIGN)with#if !defined(WOLFSSL_NO_ML_DSA_87)at the start of the ML-DSA 87 benchmark section. - Align the ML-DSA 87 section’s opening guard with its existing
#endif /* !defined(WOLFSSL_NO_ML_DSA_87) */and with other code that references ML-DSA 87.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix benchmark guard macros
Summary
wh_bench_mod_mldsa.cWOLFHSM_CFG_ENABLE_SERVERguard aroundwh_Bench_ServerCfgLoop()inwh_bench.cChanges
benchmark/bench_modules/wh_bench_mod_mldsa.cWOLFSSL_MLDSA_NO_SIGNwithWOLFSSL_NO_ML_DSA_87for ML-DSA 87 benchmark sectionbenchmark/wh_bench.cwh_Bench_ServerCfgLoop()with#if defined(WOLFHSM_CFG_ENABLE_SERVER)guardDetails
Fix typo in ML-DSA 87 guard (
wh_bench_mod_mldsa.c)The wrong macro
WOLFSSL_MLDSA_NO_SIGNwas used to guard the ML-DSA 87 benchmark section. The correct macro isWOLFSSL_NO_ML_DSA_87, consistent with the guards used for ML-DSA 44 and ML-DSA 65 in the same file.#if !defined(WOLFSSL_MLDSA_NO_SIGN)#if !defined(WOLFSSL_NO_ML_DSA_87)Without this fix, defining
WOLFSSL_NO_ML_DSA_87to disable ML-DSA 87 support would not exclude the corresponding benchmark functions from compilation.Guard server benchmark loop (
wh_bench.c)wh_Bench_ServerCfgLoop()uses server APIs (wh_Server_Init,wh_Server_HandleRequestMessage, etc.) and must not be compiled in configurations where server support is disabled. A stub implementation is provided under#elseso that callers such as_whBenchServerTask()link cleanly without server support.#if defined(WOLFHSM_CFG_ENABLE_SERVER); stub (returnsWH_ERROR_OK) provided under#elseImpact
WOLFSSL_NO_ML_DSA_87will now correctly exclude ML-DSA 87 benchmark functions.WOLFHSM_CFG_ENABLE_SERVERwill now link cleanly via the stub implementation.