def n64_split

bend-osdev-crc@0.1.0.0 · PROOF.bend:40

import bend-osdev-crc@0.1.0.0/PROOF.bend as PROOF
import Base
import bend-osdev-word64@0.1.0.0/word64.bend as W
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-crc@0.1.0.0/crc.bend as C

40def n64_split(xs: List<&2, U32>, +poly: W.W64, c: W.W64, ys: List<&2, U32>) -> {C.n64.raw(B.append(xs, ys), poly, c) == C.n64.raw(ys, poly, C.n64.raw(xs, poly, c)) : W.W64}:
41  match xs:
42    case Nil{}:
43      {==}
44    case Con{h, t}:
45      n64_split(t, poly, C.n64.bits(8n, poly, W.W64.xor(c, W.W64.from_parts(U32.shln(U32.and(h, 255), 24n), 0))), ys)

Uses (10)

Used by (1)