Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 950 Bytes

File metadata and controls

16 lines (14 loc) · 950 Bytes

Commitment Verification Test Coverage & Security Notes

Implementation & Security Assumptions

The helper verify_commitment relies on the following structural and cryptographic assumptions:

  1. Raw Pre-Image Hashing: The expected player secret must be correctly formatted as soroban_sdk::Bytes. Passing incorrect object serializations will result in mismatched hashes.
  2. SHA-256 Alignment: Soroban's native env.crypto().sha256() outputs standard BytesN<32> ensuring exact equivalence with our stored game commitments natively without string conversions.
  3. Collision Resistance: Relies entirely on the standard cryptographic security properties of SHA-256 to bind player reveals securely against their previously stored hashes.

Simulated Test Output

running 17 tests
...
test tests::test_verify_commitment ... ok
...
test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s