def xtea.key.pick

bend-osdev-legacy-ciphers@0.1.0.0 · xtea.bend:37

import bend-osdev-legacy-ciphers@0.1.0.0/xtea.bend as Xtea
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L
import bend-osdev-legacy-ciphers@0.1.0.0/tea.bend as T

37def xtea.key.pick(ok: Bool, +le: Bool, n: Nat, +xs: List<&2, U32>) -> Result<&2, &2, L.LcError, LcXteaKey>:
38  match ok:
39    case True{}:
40      Done{LcXteaKey{T.tea.order(le, xtea.cycles(n, 0, T.tea.word(le, xs, 0n), T.tea.word(le, xs, 4n), T.tea.word(le, xs, 8n), T.tea.word(le, xs, 12n)))}}
41    case False{}:
42      Fail{L.LcBadKeyLength{B.len(xs)}}

Uses (11)

Used by (1)