test(grey-crypto): add proptests for blake2b-256 and keccak-256#827
test(grey-crypto): add proptests for blake2b-256 and keccak-256#827wangzishuai1987 wants to merge 1 commit into
Conversation
Add property-based tests for the two core hash functions: blake2b-256: - Deterministic hashing - Output is always 32 bytes - Different inputs produce different hashes - Avalanche: flipping any bit changes the hash - Concatenation order matters: H(a||b) != H(b||a) - accumulate_entropy is deterministic and input-sensitive keccak-256: - Deterministic hashing - Output is always 32 bytes - Different inputs produce different hashes - Avalanche: flipping any bit changes the hash - Prefix distinctness: H(a) != H(a||extra) Refs: jarchain#229
Genesis ReviewComparison targets:
How to reviewPost a comment with the following format (rank from best to worst): Use the short commit hashes above and To meta-review another reviewer's comment, react with 👍 or 👎. |
|
/review Adds useful property coverage for the core Blake2b and Keccak hash wrappers, including determinism, output size, input sensitivity, and accumulate_entropy behavior. It ranks below the RPC validation fix, formal codec proof, safrole proptests, and erasure recovery properties because the assertions are mostly standard hash sanity checks rather than new protocol behavior. Merge is reasonable as focused crypto test coverage. |
|
JAR Bot: Review recorded from @johandroid (1 reviews, 0 meta-reviews). |
Summary
Adds property-based tests for the two core hash functions used throughout the JAM protocol:
blake2b-256 (H):
accumulate_entropyis deterministic and sensitive to both inputskeccak-256 (H_K):
These properties are fundamental to the security of Merkle trees, state commitments, and signature schemes in the protocol.
Refs: #229