law Incremental.sha256

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/hash/laws.bend:35

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/hash/laws.bend as Laws
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/hash.bend as Hash

35# Incremental hashing equals one-shot hashing for every split of the input:
36# the chunks, in order, digest to the hash of their concatenation.
37law Incremental.sha256:
38  for +chunks: List<&2, List<&2, U32>>
39  {Hash.digest(Hash.update_all(Hash.new_sha256(), chunks)) == Hash.sha256(List.concat(&2, U32, chunks)) : List<&2, U32>}

Uses (19)

Used by (2)