Twofish.tf.unop: 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 204-221 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=204&end_line=221 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 # the step undone def tf.unop(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{a, b, +c, +d}: +f = tf.f(tb, sk, c, d, ka, kb) M.CmBlock{c, d, U32.xor(L.lc.rotl1.bits(a), tf.f0(f)), L.lc.rotl31.bits(U32.xor(b, tf.f1(f)))} 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