def CrAes.key

bend-osdev-crypto@0.1.0.0 · inst_aes.bend:19

import bend-osdev-crypto@0.1.0.0/inst_aes.bend as InstAes
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend as M
import bend-osdev-cipher-modes@0.1.0.0/aes.bend as X
import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr
import bend-osdev-crypto@0.1.0.0/inst_cm.bend as CM

19# a 16- or 32-byte key (AES-128 or AES-256), with its decryption round keys;
20# CrBadKeyLength for any other length
21def CrAes.key(o: B.Octets) -> Result<&2, &2, Cr.CrError, X.CmAesKey>:
22  CM.CrCm.lift(~X.CmAesKey, Result.map(&2, &2, M.CmError, X.CmAesKey, X.CmAesKey, X.CmAes.prepare, X.CmAes.key(o)))

Uses (9)

Used by (14)