Twofish.tf.op: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend as Twofish Lines 186-202 of bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&start_line=186&end_line=202 import Base import bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend as M import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L def tf.op(o: LcTfOp, s: M.CmBlock) -> M.CmBlock: match o: case LcTfBswap{}: match s: case M.CmBlock{a, b, c, d}: M.CmBlock{L.lc.bswap.bits(a), L.lc.bswap.bits(b), L.lc.bswap.bits(c), L.lc.bswap.bits(d)} case LcTfWhite{k}: M.CmBlock.xor(s, k) case LcTfRound{tb, sk, ka, kb}: match s: case M.CmBlock{+r0, +r1, r2, r3}: +f = tf.f(tb, sk, r0, r1, ka, kb) M.CmBlock{L.lc.rotl31.bits(U32.xor(r2, tf.f0(f))), U32.xor(L.lc.rotl1.bits(r3), tf.f1(f)), r0, r1} case LcTfSwap{}: match s: case M.CmBlock{a, b, c, d}: M.CmBlock{c, d, a, b} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend&name=CmBlock https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend&name=CmBlock.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=lc.bswap.bits https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=lc.rotl1.bits https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend&name=lc.rotl31.bits https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=LcTfOp https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=tf.f https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=tf.f0 https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=tf.f1