def HsMd.final_md

bend-osdev-hashes@0.1.0.0 · hashes.bend:187

import bend-osdev-hashes@0.1.0.0/hashes.bend as Hashes
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-word64@0.1.0.0/word64.bend as W

187# The final step of a Merkle-Damgard hash: the padding with the length in
188# bits (~field writes it: eight bytes, little- or big-endian), through the
189# engine, then the digest of the chaining value (~out)
190def HsMd.final_md(~C: Data, ~compress: C -> List<&2, U32> -> C, ~last: U32, ~field: W.W64 -> List<&2, U32>, ~out: C -> B.Octets, +s: HsMdState<C>) -> B.Octets:
191  out(HsMd.cv(~C, hs.md.feed(~C, ~compress, ~last, HsMd.md_pad(~last, HsMd.count(~C, s), field(HsMd.bits(~C, ~last, s))), s)))

Uses (10)

Used by (5)