Skip to content

Adjust wolfEntropy size calculation and error out if an invalid combination of settings is given.#10884

Open
kareem-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
kareem-wolfssl:zd22127_2
Open

Adjust wolfEntropy size calculation and error out if an invalid combination of settings is given.#10884
kareem-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
kareem-wolfssl:zd22127_2

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes zd#22127

Testing

Built in tests, provided test cases

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl kareem-wolfssl self-assigned this Jul 10, 2026
Copilot AI review requested due to automatic review settings July 10, 2026 23:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the compile-time sizing logic for the wolfentropy.c MemUse entropy state buffer to ensure Entropy_MemUse()’s computed indices remain in-bounds across a wider range of ENTROPY_* macro configurations, and adds configuration validation to fail fast on clearly invalid settings.

Changes:

  • Add a compile-time error when ENTROPY_NUM_UPDATES < 1.
  • Replace the previous coarse EXTRA_ENTROPY_WORDS sizing heuristic with an exact overflow calculation based on Entropy_MemUse()’s maximum possible index.
  • Add an additional compile-time sanity check that errors out if the computed sizing is internally inconsistent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants