LAWSPadded.cbc_padded_round_trip: law of bend-osdev-cbc@0.1.0.0 Import: import bend-osdev-cbc@0.1.0.0/LAWS_padded.bend as LAWSPadded Lines 11-23 of bend-osdev-cbc@0.1.0.0/LAWS_padded.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-cbc@0.1.0.0/LAWS_padded.bend&start_line=11&end_line=23 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 import bend-osdev-cbc@0.1.0.0/cbc.bend as C # for every cipher and key with inv (as LAWS.bend's laws take it), every # 16-byte IV and every message: encryption succeeds and decryption gives the # message back law cbc_padded_round_trip: for ~K: Data for ~enc: K -> M.CmBlock -> M.CmBlock for ~dec: K -> M.CmBlock -> M.CmBlock for +k: K for inv: @xs: List<&2, M.CmBlock> -> {M.CmBlock.dec_enc(~K, ~enc, ~dec, k, xs) == xs : List<&2, M.CmBlock>} for +iv: B.Octets for +m: B.Octets for hi: {B.Octets.len(iv) == 16n : Nat} {Result.bind(&2, &2, M.CmError, B.Octets, B.Octets, C.Cbc.encrypt_padded(~K, ~enc, k, iv, m), c => C.Cbc.decrypt_padded(~K, ~dec, k, iv, c)) == Done{m} : Result<&2, &2, M.CmError, B.Octets>} Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.bind 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-bytes@0.1.1.0/bytes.bend&name=Octets.len https://jend.leeeet.dev/definition.txt?path=bend-osdev-cbc@0.1.0.0/LAWS.bend&name=cbc_round_trip https://jend.leeeet.dev/definition.txt?path=bend-osdev-cbc@0.1.0.0/PROOF_padded.bend&name=pd.go https://jend.leeeet.dev/definition.txt?path=bend-osdev-cbc@0.1.0.0/PROOF_padded.bend&name=pd.inj https://jend.leeeet.dev/definition.txt?path=bend-osdev-cbc@0.1.0.0/cbc.bend&name=Cbc.decrypt_padded https://jend.leeeet.dev/definition.txt?path=bend-osdev-cbc@0.1.0.0/cbc.bend&name=Cbc.encrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-cbc@0.1.0.0/cbc.bend&name=Cbc.encrypt_padded https://jend.leeeet.dev/definition.txt?path=bend-osdev-mode-core@0.1.0.0/mode_core.bend&name=CmBlock https://jend.leeeet.dev/definition.txt?path=bend-osdev-mode-core@0.1.0.0/mode_core.bend&name=CmBlock.dec_enc https://jend.leeeet.dev/definition.txt?path=bend-osdev-mode-core@0.1.0.0/mode_core.bend&name=CmError https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/LAWS.bend&name=pkcs7_pad_blocks https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/LAWS.bend&name=pkcs7_round_trip https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/pkcs7.bend&name=pkcs7.pad.oct