Entropy MemUse: fix for when block size less than update bits#8675
Merged
dgarske merged 2 commits intowolfSSL:masterfrom Apr 17, 2025
Merged
Entropy MemUse: fix for when block size less than update bits#8675dgarske merged 2 commits intowolfSSL:masterfrom
dgarske merged 2 commits intowolfSSL:masterfrom
Conversation
When the block size is less than the number of update bits, adding the update value will make the index larger than ENTROPY_NUM_WORDS. The update bits, ENTROPY_NUM_UPDATES_BITS, should be less than or equal to ENTROPY_BLOCK_SZ but is not practical. Add extra elements to the entropy state to accomadate this.
dgarske
previously approved these changes
Apr 16, 2025
f35ee3e to
1619029
Compare
Contributor
Author
|
retest this please |
16de51c to
e2e2e51
Compare
Call the custom high resolution time function when CUSTOM_ENTROPY_TIMEHIRES is defined with the function name.
e2e2e51 to
a34284e
Compare
Contributor
Author
|
retest this please |
dgarske
approved these changes
Apr 17, 2025
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.
Description
When the block size is less than the number of update bits, adding the update value will make the index larger than ENTROPY_NUM_WORDS. The update bits, ENTROPY_NUM_UPDATES_BITS, should be less than or equal to ENTROPY_BLOCK_SZ but is not practical.
Add extra elements to the entropy state to accomadate this.
Call the custom high resolution time function when CUSTOM_ENTROPY_TIMEHIRES is defined with the function name.
Fixes zd#19728, zd#19727
Testing
./configure --disable-shared --enable-debug --enable-entropy-memuse 'CFLAGS=-DENTROPY_NUM_WORDS_BITS=9 -DWOLFSSL_DEBUG_ENTROPY_MEMUSE' 'CC=clang -fsanitize=address'
./wolfccrypt/test/testwolfcrypt
Checklist