def HsMd.bits

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

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

168# The length so far in bits, modulo 2^64 (blocks of last + 1 bytes)
169def HsMd.bits(~C: Data, ~last: U32, +s: HsMdState<C>) -> W.W64:
170  W.W64.add(W.W64.mul(HsMd.blocks(~C, s), W.W64.from_u32(U32.shln(U32.add(last, 1), 3n))), W.W64.from_u32(U32.shln(HsMd.count(~C, s), 3n)))

Uses (10)

Used by (6)