Gf128.Gf128.double_be: def of bend-osdev-gf@0.1.1.0 Import: import bend-osdev-gf@0.1.1.0/gf128.bend as Gf128 Lines 98-103 of bend-osdev-gf@0.1.1.0/gf128.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-gf@0.1.1.0/gf128.bend&start_line=98&end_line=103 import Base # big-endian (CMAC's doubling, LRW): shift left one bit; a carry adds 0x87 # to byte 15 def Gf128.double_be(v: Gf128) -> Gf128: match v: case Gf128{+w0, +w1, +w2, +w3}: Gf128{U32.or(U32.shl(w0), U32.shrn(w1, 31n)), U32.or(U32.shl(w1), U32.shrn(w2, 31n)), U32.or(U32.shl(w2), U32.shrn(w3, 31n)), U32.xor(U32.shl(w3), U32.and(135, gf128.mask(U32.shrn(w0, 31n))))} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shl https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf128.bend&name=Gf128 https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf128.bend&name=gf128.mask