def sized
import bend-collections@1.0.0.0/spec/crypto/sha/packed.bend as Packedimport Base
import bend-collections@1.0.0.0/src/crypto/sha/state.bend as S
101def sized(+length: Nat, pair: Array<U32> & U32) -> Maybe<&2,S.State>:
102 (a,capacity) = pair
103 checked(Nat.is_le(length,Nat.mul(4n,U32.to_nat(capacity))),a,length)