Skip to content

Improve parameter validation for a number of operations where exceptions otherwise caused.#2586

Merged
GCHQDeveloper581 merged 7 commits into
gchq:masterfrom
GCHQDeveloper581:bug/fix-2448
Jun 22, 2026
Merged

Improve parameter validation for a number of operations where exceptions otherwise caused.#2586
GCHQDeveloper581 merged 7 commits into
gchq:masterfrom
GCHQDeveloper581:bug/fix-2448

Conversation

@GCHQDeveloper581

@GCHQDeveloper581 GCHQDeveloper581 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Description
Improve the parameter validation, using the new framework added in #2561, for a number of operations that would otherwise throw an exception during baking.

Operations fixed:

  • BitShiftLeft
  • BLAKE3
  • PseudoRandomNumberGenerator
  • ToBase
  • ToBinary
  • XORBruteForce

Also tidied up a couple of outstanding linting warnings.

Existing Issues
Fixes #2448 (PseudoRandomNumberGenerator)
Fixes #2482 (BitShiftLeft)
Fixes #2484 (ToBinary)
Fixes #2487 (ToBase)
Fixes #2512 (BLAKE3)

AI disclosure
No AI used

Test Coverage
Additional tests added for BLAKE3 based on the canonical test vectors.

Parameter validation fixes are covered by existing automated parameter validation tests and adding per-operation tests would significantly increase the number of tests in the code base without providing any real added benefit.

@GCHQDeveloper581 GCHQDeveloper581 changed the title Prevent RangeError in Pseudo-Random Number generator by setting minimum limit on number of bytes Improve parameter validation for a number of operations where exceptions otherwise caused. Jun 21, 2026
Comment thread src/core/operations/ToBinary.mjs
@GCHQDeveloper581 GCHQDeveloper581 merged commit 080357a into gchq:master Jun 22, 2026
2 checks passed
@GCHQDeveloper581 GCHQDeveloper581 deleted the bug/fix-2448 branch June 22, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment