def LcBlowfish.key

bend-osdev-legacy-ciphers@0.1.0.0 · blowfish.bend:363

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

363# a key of 4 to 56 bytes (32 to 448 bits, as the specification says)
364def LcBlowfish.key(o: B.Octets) -> Result<&2, &2, L.LcError, LcBlowfishKey>:
365  +xs = B.Octets.to_list(o)
366  +n = B.len(xs)
367  bf.key.pick(Bool.and(Nat.is_le(4n, n), Nat.is_le(n, 56n)), xs)

Uses (9)

Used by (3)