def tea.word

bend-osdev-legacy-ciphers@0.1.0.0 · tea.bend:107

import bend-osdev-legacy-ciphers@0.1.0.0/tea.bend as Tea
import Base
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L

107# the four key words, little-endian (le True) or big-endian
108def tea.word(le: Bool, +xs: List<&2, U32>, +i: Nat) -> U32:
109  match le:
110    case True{}:
111      L.lc.le(L.lc.at(xs, i), L.lc.at(xs, Nat.add(i, 1n)), L.lc.at(xs, Nat.add(i, 2n)), L.lc.at(xs, Nat.add(i, 3n)))
112    case False{}:
113      L.lc.be(L.lc.at(xs, i), L.lc.at(xs, Nat.add(i, 1n)), L.lc.at(xs, Nat.add(i, 2n)), L.lc.at(xs, Nat.add(i, 3n)))

Uses (8)

Used by (2)