def t32.n.raw

bend-osdev-crc@0.1.0.0 · table.bend:47

import bend-osdev-crc@0.1.0.0/table.bend as Table
import Base

47# most significant bit first: c = ((c << 8) ^ T[((c >> (w - 8)) ^ b) & 255]) & mask
48def t32.n.raw(xs: List<&2, U32>, +shift: Nat, +mask: U32, r: Array<U32> & U32) -> Array<U32> & U32:
49  match xs:
50    case Nil{}:
51      r
52    case Con{h, t}:
53      (tab, +c) = r
54      t32.n.raw(t, shift, mask, t32.n.fin(Array.get(U32, tab, U32.and(U32.xor(U32.shrn(c, shift), h), 255)), c, mask))

Uses (11)

Used by (1)