From 39fb5ccd69dd7260d62a0e44b3076afd145362de Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Thu, 21 May 2026 00:13:52 +0200 Subject: [PATCH] refactor(xmss/prf): drop redundant message length check The parameter is typed Bytes32, which enforces a 32-byte payload at construction. MESSAGE_LENGTH is also 32 in every prod and test config, so the runtime length check could never fire from the single internal call site. No test pinned the error message. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lean_spec/subspecs/xmss/prf.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/lean_spec/subspecs/xmss/prf.py b/src/lean_spec/subspecs/xmss/prf.py index aff01cd3..b90bed66 100644 --- a/src/lean_spec/subspecs/xmss/prf.py +++ b/src/lean_spec/subspecs/xmss/prf.py @@ -184,12 +184,6 @@ def get_randomness( """ config = self.config - # Validate message length - if len(message) != config.MESSAGE_LENGTH: - raise ValueError( - f"Message must be exactly {config.MESSAGE_LENGTH} bytes, got {len(message)}" - ) - # Construct input: DOMAIN_SEP || 0x01 || key || epoch || message || counter input_data = ( PRF_DOMAIN_SEP