def lc128
bend-osdev-crypto@0.1.0.0 · check.bend:176
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-crypto@0.1.0.0/crypto.bend as Cr
import bend-osdev-crypto@0.1.0.0/block.bend as Bk
import bend-osdev-crypto@0.1.0.0/inst_cm.bend as CM
176def lc128(~K: Data, ~key: B.Octets -> Result<&2, &2, Cr.CrError, K>, ~enc: K -> M.CmBlock -> M.CmBlock, ~dec: K -> M.CmBlock -> M.CmBlock, +k: B.Octets, +p: B.Octets) -> String:
177 +c = Bk.CrBlockCipher.encrypt_with(~K, ~M.CmBlock, ~key, ~enc, ~CM.CrBlk128.of_octets, ~CM.CrBlk128.to_octets, k, p)
178 both(c, Result.bind(&2, &2, Cr.CrError, B.Octets, B.Octets, c, x => Bk.CrBlockCipher.encrypt_with(~K, ~M.CmBlock, ~key, ~dec, ~CM.CrBlk128.of_octets, ~CM.CrBlk128.to_octets, k, x)))