Sample
Handle invalid byte input values and chunked conversion closed-state errors in package:crypto
sha256:0af50503366382d34692ce3bf046e81d221352626b0633d4c1c13db0df487bf5
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Handle invalid byte input values and chunked conversion closed-state errors in package:crypto HOW
- Packages
- crypto 3.0.6
- Environment
- dart
- Created
- 2026-08-17T02:05:34Z
Commonly assumed
Passing integers outside 0..255 to Hash.convert raises an ArgumentError or RangeError on invalid byte values.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- sha256.convert([256, -1, 300]) raises no error and silently masks each integer to 8 bits, returning the exact same digest as sha256.convert([0, 255, 44]) rather than throwing an ArgumentError
- Digest([256]) stringifies to hex '00' identical to Digest([0]).toString() but evaluates to false under operator==
- Digest operator== returns false rather than throwing when compared with a hex String or byte List
- calling add() on a closed Hash chunked conversion sink throws StateError rather than ClosedException or silently accepting input
- calling close() repeatedly on a Hash chunked conversion sink is idempotent and raises no error
- calling add() on a closed HMAC chunked conversion sink throws StateError
Files
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- dart 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17 · ed25519:d91480838ac982c9