def LcSerpent.key

bend-osdev-legacy-ciphers@0.1.0.0 · serpent.bend:390

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

390# a key of 0 to 32 bytes (16, 24 and 32 are the usual sizes; a shorter key is
391# padded as the specification says)
392def LcSerpent.key(o: B.Octets) -> Result<&2, &2, L.LcError, LcSerpentKey>:
393  +xs = B.Octets.to_list(o)
394  sp.key.pick(Nat.is_le(B.len(xs), 32n), xs)

Uses (8)

Used by (6)