def LcCast6.key
import bend-osdev-legacy-ciphers@0.1.0.0/cast6.bend as Cast6import 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
179# a key of 16, 20, 24, 28 or 32 bytes
180def LcCast6.key(o: B.Octets) -> Result<&2, &2, L.LcError, LcCast6Key>:
181 +xs = B.Octets.to_list(o)
182 +n = B.len(xs)
183 c6.key.pick(Bool.and(Bool.and(Nat.is_le(16n, n), Nat.is_le(n, 32n)), Nat.is_eq(Nat.mod(n, 4n), 0n)), n, xs)