Compress.diagonal: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend as Compress Lines 56-92 of bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend&start_line=56&end_line=92 import Base import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/types.bend as T # G on the four diagonals, message words m8..m15. def diagonal(s: T.St, +m8: U32, +m9: U32, +m10: U32, +m11: U32, +m12: U32, +m13: U32, +m14: U32, +m15: U32) -> T.St: match s: case T.St{+v0,+v1,+v2,+v3,+v4,+v5,+v6,+v7,+v8,+v9,+v10,+v11,+v12,+v13,+v14,+v15}: +t0 = U32.add(U32.add(v0,v5),m8) +t1 = rot16(U32.xor(v15,t0)) +t2 = U32.add(v10,t1) +t3 = rot12(U32.xor(v5,t2)) +t4 = U32.add(U32.add(t0,t3),m9) +t5 = rot8(U32.xor(t1,t4)) +t6 = U32.add(t2,t5) +t7 = rot7(U32.xor(t3,t6)) +t8 = U32.add(U32.add(v1,v6),m10) +t9 = rot16(U32.xor(v12,t8)) +t10 = U32.add(v11,t9) +t11 = rot12(U32.xor(v6,t10)) +t12 = U32.add(U32.add(t8,t11),m11) +t13 = rot8(U32.xor(t9,t12)) +t14 = U32.add(t10,t13) +t15 = rot7(U32.xor(t11,t14)) +t16 = U32.add(U32.add(v2,v7),m12) +t17 = rot16(U32.xor(v13,t16)) +t18 = U32.add(v8,t17) +t19 = rot12(U32.xor(v7,t18)) +t20 = U32.add(U32.add(t16,t19),m13) +t21 = rot8(U32.xor(t17,t20)) +t22 = U32.add(t18,t21) +t23 = rot7(U32.xor(t19,t22)) +t24 = U32.add(U32.add(v3,v4),m14) +t25 = rot16(U32.xor(v14,t24)) +t26 = U32.add(v9,t25) +t27 = rot12(U32.xor(v4,t26)) +t28 = U32.add(U32.add(t24,t27),m15) +t29 = rot8(U32.xor(t25,t28)) +t30 = U32.add(t26,t29) +t31 = rot7(U32.xor(t27,t30)) T.St{t4,t12,t20,t28,t31,t7,t15,t23,t22,t30,t6,t14,t13,t21,t29,t5} Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend&name=rot12 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend&name=rot16 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend&name=rot7 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/compress.bend&name=rot8 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake3/types.bend&name=St