def CmAes.key

bend-osdev-aes@0.1.0.0 · aes.bend:216

import bend-osdev-aes@0.1.0.0/aes.bend as Aes
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import bend-osdev-mode-core@0.1.0.0/mode_core.bend as M

216# a 16-byte (AES-128) or 32-byte (AES-256) key
217def CmAes.key(o: B.Octets) -> Result<&2, &2, M.CmError, CmAesKey>:
218  +xs = B.Octets.to_list(o)
219  +n = B.len(xs)
220  aes.key.pick(Bool.or(Nat.is_eq(n, 16n), Nat.is_eq(n, 32n)), xs)

Uses (9)

Used by (0)

No other definition uses this definition.