Skip to content

Validate Whirlpool rounds#2525

Open
marko1olo wants to merge 1 commit into
gchq:masterfrom
marko1olo:fix-whirlpool-rounds-validation
Open

Validate Whirlpool rounds#2525
marko1olo wants to merge 1 commit into
gchq:masterfrom
marko1olo:fix-whirlpool-rounds-validation

Conversation

@marko1olo

@marko1olo marko1olo commented Jun 6, 2026

Copy link
Copy Markdown

Fixes #2508.

Whirlpool exposes Rounds as a numeric option with a UI range of 1-10, but the operation accepted direct API/recipe values outside that range. Passing a negative round count through to crypto-api produced the reported all-zero Whirlpool output.

This adds runtime validation for integer rounds in the supported 1-10 range, while preserving existing recipes that omit the second argument by defaulting to 10 rounds.

AI disclosure:

  • This change was prepared with assistance from OpenAI Codex.

Validation:

  • node --no-warnings --no-deprecation --openssl-legacy-provider tests/operations/index.mjs passed: 1962 passing.
  • npx eslint src/core/operations/Whirlpool.mjs tests/operations/tests/Hash.mjs passed.
  • npx grunt configTests passed.
  • git diff --check passed.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Whirlpool): Negative rounds leads to just 0s nothing more all is 0s

3 participants