def tf.ops

bend-osdev-legacy-ciphers@0.1.0.0 · twofish.bend:309

import bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend as Twofish
import Base
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L

309# the steps from the subkey pairs (K_0, K_1) .. (K_38, K_39)
310def tf.ops(ks: List<&2, L.LcBlock64>, +t: LcTfTabs, +s: List<&2, U32>) -> List<&2, LcTfOp>:
311  match ks:
312    case Con{p0, Con{p1, Con{p2, Con{p3, rest}}}}:
313      Con{LcTfBswap{}, Con{tf.white.le(p0, p1), tf.append(tf.rounds(rest, t, s), [LcTfSwap{}, tf.white.le(p2, p3), LcTfBswap{}])}}
314    case _:
315      Nil{}

Uses (8)

Used by (1)