def gfm.mul.go

bend-osdev-gf@0.1.1.0 · gfm.bend:61

import bend-osdev-gf@0.1.1.0/gfm.bend as Gfm
import Base

61# the product, over the m bits of b from the bottom: p += a * bit; a *= x
62def gfm.mul.go(n: Nat, +m: Nat, +poly: U32, +a: U32, +b: U32, p: U32) -> U32:
63  match n:
64    case 0n:
65      p
66    case 1n+k:
67      gfm.mul.go(k, m, poly, gfm.x(m, poly, a), U32.shr(b), U32.xor(p, U32.and(a, gfm.mask(b))))

Uses (7)

Used by (1)