Streebog.hs.stb.lps: def of bend-osdev-hashes@0.1.0.0 Import: import bend-osdev-hashes@0.1.0.0/streebog.bend as Streebog Lines 698-711 of bend-osdev-hashes@0.1.0.0/streebog.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-hashes@0.1.0.0/streebog.bend&start_line=698&end_line=711 import Base import bend-osdev-hashes@0.1.0.0/hashes.bend as Hs # BEGIN GENERATED by gen/streebog.py: lps # LPS(x): chunk k of the result is the XOR over j of T_j[byte k of chunk j] def hs.stb.lps(+t: HsStbTabs, x: Hs.HsW16) -> Hs.HsW16: match t x: case HsStbTabs{+t0, +t1, +t2, +t3, +t4, +t5, +t6, +t7} Hs.HsW16{+x0, +x1, +x2, +x3, +x4, +x5, +x6, +x7, +x8, +x9, +x10, +x11, +x12, +x13, +x14, +x15}: +o0 = hs.stb.x8(hs.stb.get(t0, U32.and(255, x0)), hs.stb.get(t1, U32.and(255, x2)), hs.stb.get(t2, U32.and(255, x4)), hs.stb.get(t3, U32.and(255, x6)), hs.stb.get(t4, U32.and(255, x8)), hs.stb.get(t5, U32.and(255, x10)), hs.stb.get(t6, U32.and(255, x12)), hs.stb.get(t7, U32.and(255, x14))) +o1 = hs.stb.x8(hs.stb.get(t0, U32.and(255, U32.shrn(x0, 8n))), hs.stb.get(t1, U32.and(255, U32.shrn(x2, 8n))), hs.stb.get(t2, U32.and(255, U32.shrn(x4, 8n))), hs.stb.get(t3, U32.and(255, U32.shrn(x6, 8n))), hs.stb.get(t4, U32.and(255, U32.shrn(x8, 8n))), hs.stb.get(t5, U32.and(255, U32.shrn(x10, 8n))), hs.stb.get(t6, U32.and(255, U32.shrn(x12, 8n))), hs.stb.get(t7, U32.and(255, U32.shrn(x14, 8n)))) +o2 = hs.stb.x8(hs.stb.get(t0, U32.and(255, U32.shrn(x0, 16n))), hs.stb.get(t1, U32.and(255, U32.shrn(x2, 16n))), hs.stb.get(t2, U32.and(255, U32.shrn(x4, 16n))), hs.stb.get(t3, U32.and(255, U32.shrn(x6, 16n))), hs.stb.get(t4, U32.and(255, U32.shrn(x8, 16n))), hs.stb.get(t5, U32.and(255, U32.shrn(x10, 16n))), hs.stb.get(t6, U32.and(255, U32.shrn(x12, 16n))), hs.stb.get(t7, U32.and(255, U32.shrn(x14, 16n)))) +o3 = hs.stb.x8(hs.stb.get(t0, U32.and(255, U32.shrn(x0, 24n))), hs.stb.get(t1, U32.and(255, U32.shrn(x2, 24n))), hs.stb.get(t2, U32.and(255, U32.shrn(x4, 24n))), hs.stb.get(t3, U32.and(255, U32.shrn(x6, 24n))), hs.stb.get(t4, U32.and(255, U32.shrn(x8, 24n))), hs.stb.get(t5, U32.and(255, U32.shrn(x10, 24n))), hs.stb.get(t6, U32.and(255, U32.shrn(x12, 24n))), hs.stb.get(t7, U32.and(255, U32.shrn(x14, 24n)))) +o4 = hs.stb.x8(hs.stb.get(t0, U32.and(255, x1)), hs.stb.get(t1, U32.and(255, x3)), hs.stb.get(t2, U32.and(255, x5)), hs.stb.get(t3, U32.and(255, x7)), hs.stb.get(t4, U32.and(255, x9)), hs.stb.get(t5, U32.and(255, x11)), hs.stb.get(t6, U32.and(255, x13)), hs.stb.get(t7, U32.and(255, x15))) +o5 = hs.stb.x8(hs.stb.get(t0, U32.and(255, U32.shrn(x1, 8n))), hs.stb.get(t1, U32.and(255, U32.shrn(x3, 8n))), hs.stb.get(t2, U32.and(255, U32.shrn(x5, 8n))), hs.stb.get(t3, U32.and(255, U32.shrn(x7, 8n))), hs.stb.get(t4, U32.and(255, U32.shrn(x9, 8n))), hs.stb.get(t5, U32.and(255, U32.shrn(x11, 8n))), hs.stb.get(t6, U32.and(255, U32.shrn(x13, 8n))), hs.stb.get(t7, U32.and(255, U32.shrn(x15, 8n)))) +o6 = hs.stb.x8(hs.stb.get(t0, U32.and(255, U32.shrn(x1, 16n))), hs.stb.get(t1, U32.and(255, U32.shrn(x3, 16n))), hs.stb.get(t2, U32.and(255, U32.shrn(x5, 16n))), hs.stb.get(t3, U32.and(255, U32.shrn(x7, 16n))), hs.stb.get(t4, U32.and(255, U32.shrn(x9, 16n))), hs.stb.get(t5, U32.and(255, U32.shrn(x11, 16n))), hs.stb.get(t6, U32.and(255, U32.shrn(x13, 16n))), hs.stb.get(t7, U32.and(255, U32.shrn(x15, 16n)))) +o7 = hs.stb.x8(hs.stb.get(t0, U32.and(255, U32.shrn(x1, 24n))), hs.stb.get(t1, U32.and(255, U32.shrn(x3, 24n))), hs.stb.get(t2, U32.and(255, U32.shrn(x5, 24n))), hs.stb.get(t3, U32.and(255, U32.shrn(x7, 24n))), hs.stb.get(t4, U32.and(255, U32.shrn(x9, 24n))), hs.stb.get(t5, U32.and(255, U32.shrn(x11, 24n))), hs.stb.get(t6, U32.and(255, U32.shrn(x13, 24n))), hs.stb.get(t7, U32.and(255, U32.shrn(x15, 24n)))) hs.stb.join(o0, o1, o2, o3, o4, o5, o6, o7) 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.shrn https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/hashes.bend&name=HsW16 https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/streebog.bend&name=HsStbTabs https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/streebog.bend&name=hs.stb.get https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/streebog.bend&name=hs.stb.join https://jend.leeeet.dev/definition.txt?path=bend-osdev-hashes@0.1.0.0/streebog.bend&name=hs.stb.x8