Check.cbc128: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/check.bend as Check Lines 207-210 of bend-osdev-legacy-ciphers@0.1.0.0/check.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/check.bend&start_line=207&end_line=210 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/cbc.bend as CB def cbc128(~K: Data, ~enc: K -> M.CmBlock -> M.CmBlock, ~dec: K -> M.CmBlock -> M.CmBlock, +k: K, n: Nat) -> String: +m = big(n) +c = CB.Cbc.encrypt(~K, ~enc, k, iv16(), m) last16(c) ++ " " ++ same(Result.bind(&2, &2, M.CmError, B.Octets, B.Octets, c, x => CB.Cbc.decrypt(~K, ~dec, k, iv16(), x)), m) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cbc.bend&name=Cbc.decrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cbc.bend&name=Cbc.encrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend&name=CmBlock https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend&name=CmError https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/check.bend&name=big https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/check.bend&name=iv16 https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/check.bend&name=last16 https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/check.bend&name=same