def LcCast5.key

bend-osdev-legacy-ciphers@0.1.0.0 · cast5.bend:508

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

508# a key of 5 to 16 bytes (40 to 128 bits); up to 10 bytes, 12 rounds
509def LcCast5.key(o: B.Octets) -> Result<&2, &2, L.LcError, LcCast5Key>:
510  +xs = B.Octets.to_list(o)
511  +n = B.len(xs)
512  cast5.key.pick(Bool.and(Nat.is_le(5n, n), Nat.is_le(n, 16n)), n, xs)

Uses (9)

Used by (5)