Gf.Gf8Bits.x: def of bend-osdev-gf@0.1.1.0 Import: import bend-osdev-gf@0.1.1.0/gf.bend as Gf Lines 77-82 of bend-osdev-gf@0.1.1.0/gf.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&start_line=77&end_line=82 import Base # a times x, where p holds the low 8 bits of the polynomial: shift up one # place, and if the coefficient of x^8 was set, add p (x^8 = p in the field) def Gf8Bits.x(a: Gf8Bits, p: Gf8Bits) -> Gf8Bits: match a p: case Gf8Bits{a0, a1, a2, a3, a4, a5, a6, +a7} Gf8Bits{p0, p1, p2, p3, p4, p5, p6, p7}: Gf8Bits{Bool.and(a7, p0), Bool.xor(a0, Bool.and(a7, p1)), Bool.xor(a1, Bool.and(a7, p2)), Bool.xor(a2, Bool.and(a7, p3)), Bool.xor(a3, Bool.and(a7, p4)), Bool.xor(a4, Bool.and(a7, p5)), Bool.xor(a5, Bool.and(a7, p6)), Bool.xor(a6, Bool.and(a7, p7))} Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8Bits