def stream

mylsm-lsm-store@0.6.0.1 · src/hub_sha/core.bend:3563

import mylsm-lsm-store@0.6.0.1/src/hub_sha/core.bend as Core
import Base
import mylsm-lsm-store@0.6.0.1/src/hub_sha/state.bend as S

3563# Compress complete 64-byte blocks straight from the input list, so the
3564# message is never copied, counted or reversed. count is the number of bytes
3565# already hashed and extra the number of derived schedule words (48).
3566def stream(+bytes: List<&2, U32>, count: Nat, +extra: Nat, state: S.State) -> S.State:
3567  match bytes:
3568    case b0 <> b1 <> b2 <> b3 <> b4 <> b5 <> b6 <> b7 <> b8 <> b9 <> b10 <> b11 <> b12 <> b13 <> b14 <> b15 <> b16 <> b17 <> b18 <> b19 <> b20 <> b21 <> b22 <> b23 <> b24 <> b25 <> b26 <> b27 <> b28 <> b29 <> b30 <> b31 <> b32 <> b33 <> b34 <> b35 <> b36 <> b37 <> b38 <> b39 <> b40 <> b41 <> b42 <> b43 <> b44 <> b45 <> b46 <> b47 <> b48 <> b49 <> b50 <> b51 <> b52 <> b53 <> b54 <> b55 <> b56 <> b57 <> b58 <> b59 <> b60 <> b61 <> b62 <> b63 <> rest:
3569      stream(rest, Nat.add(64n, count), extra, fips_compress16(
3570        pack(b0, b1, b2, b3), pack(b4, b5, b6, b7), pack(b8, b9, b10, b11), pack(b12, b13, b14, b15),
3571        pack(b16, b17, b18, b19), pack(b20, b21, b22, b23), pack(b24, b25, b26, b27), pack(b28, b29, b30, b31),
3572        pack(b32, b33, b34, b35), pack(b36, b37, b38, b39), pack(b40, b41, b42, b43), pack(b44, b45, b46, b47),
3573        pack(b48, b49, b50, b51), pack(b52, b53, b54, b55), pack(b56, b57, b58, b59), pack(b60, b61, b62, b63),
3574        extra, state))
3575    case _:
3576      finish(bytes, count, extra, state)

Uses (8)

Used by (1)