def xcbc_aes

bend-osdev-crypto@0.1.0.0 · check.bend:330

import bend-osdev-crypto@0.1.0.0/check.bend as Check
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
import bend-osdev-crypto@0.1.0.0/inst_aes.bend as A
import bend-osdev-crypto@0.1.0.0/xcbc.bend as Xc

330def xcbc_aes(+k: B.Octets, +m: B.Octets) -> String:
331  show(Result.map(&2, &2, Cr.CrError, Xc.CrXcbcKey<X.CmAesKey>, B.Octets, kk => Xc.CrXcbc.mac(~X.CmAesKey, ~M.CmBlock, ~16n, ~X.CmAes.encrypt, ~CM.CrBlk128.of_octets, ~CM.CrBlk128.to_octets, kk, m), Xc.CrXcbc.key(~X.CmAesKey, ~M.CmBlock, ~16n, ~A.CrAes.key, ~X.CmAes.encrypt, ~CM.CrBlk128.of_octets, ~CM.CrBlk128.to_octets, k)))

Uses (14)

Used by (1)