def checked
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha/packed.bend as Packedimport Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha/state.bend as S
96def checked(valid: Bool, a: Array<U32>, length: Nat) -> Maybe<&2,S.State>:
97 match valid:
98 case False{}: None{}
99 case True{}: Some{hash_unchecked(a,length)}