sha3: add Memory Usage bench and Security Considerations docs - #95
Open
ounsworth wants to merge 1 commit into
Open
sha3: add Memory Usage bench and Security Considerations docs#95ounsworth wants to merge 1 commit into
ounsworth wants to merge 1 commit into
Conversation
…age bench QUALITY_AND_STYLE.md requires every primitive crate's docs to carry a "Memory Usage" section with a stack-usage table and, usually, a "Security Considerations" section; SHA-3 had neither. The Memory Usage table's figures come from a new mem_usage_benches/bench_sha3_mem_usage.rs, following the existing bench_mldsa_mem_usage / bench_mlkem_mem_usage: print_struct_sizes() reports size_of for SHA3_224..SHA3_512 and SHAKE128/256 (all 440 bytes, since every variant shares the same Keccak-f[1600] sponge) and SUSPENDED_SHA3_STATE_LEN (415). The remaining entry points -- one-shot hash, streaming, XOF squeeze, suspend/resume -- exist for valgrind --tool=massif peak-stack measurement, which criterion cannot do. Security Considerations cites FIPS 202 Appendix A.1 for the strengths and A.2 for the XOF prefix property (SHAKE128(m, 32) is a prefix of SHAKE128(m, 64)), and notes that the sponge state is held in Secret and zeroized on drop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Break up of #87, so this is actually dgh's submission. So I will be reviewing / approving.
QUALITY_AND_STYLE.md requires every primitive crate's docs to carry a "Memory Usage" section with a stack-usage table and, usually, a "Security Considerations" section; SHA-3 had neither.
The Memory Usage table's figures come from a new
mem_usage_benches/bench_sha3_mem_usage.rs, following the existing bench_mldsa_mem_usage / bench_mlkem_mem_usage: print_struct_sizes() reports size_of for SHA3_224..SHA3_512 and SHAKE128/256 (all 440 bytes, since every variant shares the same Keccak-f[1600] sponge) and SUSPENDED_SHA3_STATE_LEN (415). The remaining entry points -- one-shot hash, streaming, XOF squeeze, suspend/resume -- exist for valgrind --tool=massif peak-stack measurement, which criterion cannot do.
Security Considerations cites FIPS 202 Appendix A.1 for the strengths and A.2 for the XOF prefix property (SHAKE128(m, 32) is a prefix of SHAKE128(m, 64)), and notes that the sponge state is held in Secret and zeroized on drop.