def LcXtea.key_with

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

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

46# a 16-byte key, words in the order le picks (True: little-endian), and n
47# cycles (32 recommended)
48def LcXtea.key_with(le: Bool, n: Nat, o: B.Octets) -> Result<&2, &2, L.LcError, LcXteaKey>:
49  +xs = B.Octets.to_list(o)
50  xtea.key.pick(Nat.is_eq(B.len(xs), 16n), le, n, xs)

Uses (10)

Used by (3)