def gfm.x

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

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

51# a * x for a below 2^m: shift, and reduce if x^m appeared
52def gfm.x(+m: Nat, +poly: U32, a: U32) -> U32:
53  +s = U32.shl(a)
54  U32.xor(s, U32.and(poly, gfm.mask(U32.shrn(s, m))))

Uses (7)

Used by (2)