def tf.words

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

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

239# the little-endian words of the key bytes xs, every other one from word i
240def tf.words(n: Nat, +xs: List<&2, U32>, +i: Nat) -> List<&2, U32>:
241  match n:
242    case 0n:
243      Nil{}
244    case 1n+p:
245      +j = Nat.mul(4n, i)
246      Con{L.lc.le(L.lc.at(xs, j), L.lc.at(xs, Nat.add(j, 1n)), L.lc.at(xs, Nat.add(j, 2n)), L.lc.at(xs, Nat.add(j, 3n))), tf.words(p, xs, Nat.add(i, 2n))}

Uses (7)

Used by (1)