def LcTea.key_with

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

import bend-osdev-legacy-ciphers@0.1.0.0/tea.bend as Tea
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

153# a 16-byte key, words in the order le picks (True: little-endian), and n
154# cycles (32 recommended)
155def LcTea.key_with(le: Bool, n: Nat, o: B.Octets) -> Result<&2, &2, L.LcError, LcTeaKey>:
156  +xs = B.Octets.to_list(o)
157  tea.key.pick(Nat.is_eq(B.len(xs), 16n), le, n, xs)

Uses (10)

Used by (3)