def finish512
import bend-collections@1.0.0.0/src/crypto/hash.bend as Hashimport Base
import bend-collections@1.0.0.0/src/crypto/sha512/core.bend as C512
346def finish512(st: Sha512State, +len: Nat, +q: Nat) -> List<&2, U32>:
347 match st:
348 case St512{s, buf}:
349 C512.digest_bytes(C512.blocks(C512.lanes(List.append(&2, U32, buf, C512.suffix(len))), q, C512.round_constants(), s))