Repository navigation
feat(u32): add embedded constant XNOR - #147
Conversation
|
Review: changes required before merge. The checked byte boundary misses three original input limbs. With four witness items encoding numeric 1, replacing any bottom-based position 0, 1, or 2 by the nonminimal encoding [0x01, 0x00] still succeeds under the local Tapscript Consensus profile after consuming the four outputs and appending OP_TRUE. Position 3 is rejected. Validate each original byte before arithmetic normalizes it; move or stage the validated limb before repeating the check. Add malformed-encoding regressions at every position under a profile that permits nonminimal numeric encodings globally. Evidence: Reviewed commit: |
47c1a71 to
3a9a077
Compare
|
Updated in commit The fix validates each original hostile limb before normalization by rotating the next limb into the checker with Refreshed metrics/docs: 686 script bytes, 502 static non-push opcodes, 272 peak stack items, 13-byte witness. Validation passed:
|
|
Review of The validator now rotates through all four original limbs, addressing the earlier top-limb-only check. Preserve malformed/nonminimal inputs at every position and the XNOR result/order regressions. Rebase and rerun the focused XNOR and named metric checks plus KB validation. Current integration conflicts: Validation scope: source/diff and existing CI review; no new full-repository or field-arithmetic test run was requested. |
|
Addressed in
Validation: 3 focused library tests passed, the named metric test passed, KB validation passed (102 records / 257 configurations), and formatting/whitespace checks passed. Current execution uses interpreter Historical execution used compiler |
Adds checked XNOR between a four-byte runtime u32 word and a public embedded mask. The fragment validates every original limb for byte range and canonical ScriptNum encoding, uses and removes the shared Boolean table, and returns four result limbs in their original order.
The mask
0x89abcdefconfiguration measures 686 policy-produced script bytes, 13 serialized data-witness bytes across four items, zero hints, a 272-item combined-stack peak, and 502 static non-push opcodes. This is a fragment-with-memory boundary; data witness bytes exclude Taproot transaction framing. Evidence is locally-reproduced and deployment remains unclassified.Current main is integrated while retaining its catalog entries, APIs, exports, and metric tests. Coverage includes runtime result/order checks, malformed raw encodings at every position under a permissive numeric-encoding profile, valid controls, a faithful historical mutant, and surrounding-state preservation.
Validation: three focused library tests, the named metric test, KB validation (102 records / 257 configurations), formatting, and whitespace checks passed. No Bitcoin Core or relay-policy validation is claimed.