PROOF.pk.main2: def of bend-osdev-pkcs7@0.1.0.0 Import: import bend-osdev-pkcs7@0.1.0.0/PROOF.bend as PROOF Lines 1361-1366 of bend-osdev-pkcs7@0.1.0.0/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-pkcs7@0.1.0.0/PROOF.bend&start_line=1361&end_line=1366 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-pkcs7@0.1.0.0/pkcs7.bend as P # the round trip for a block size 1 + q (q below 255) and a padding of # 1 + p1 bytes, p1 <= q, that makes whole blocks def pk.main2(+q: Nat, +m: B.Octets, +p1: Nat, +hle: {Nat.is_le(p1, q) == True{} : Bool}, hb: {Nat.is_le(1n+q, 255n) == True{} : Bool}, hm: {Nat.mod(1n+Nat.add(B.Octets.len(m), p1), 1n+q) == 0n : Nat}) -> {P.Pkcs7.unpad.go(True{}, 1n+q, B.Octets.append(m, pk.pad(p1))) == Done{m} : Result<&2, &2, M.CmError, B.Octets>}: %Equal.sym(Nat, B.Octets.len(B.Octets.append(m, pk.pad(p1))), 1n+Nat.add(B.Octets.len(m), p1), pk.len(m, p1)) : {pk.ug(1n+q, B.Octets.append(m, pk.pad(p1)), _, Nat.mod(_, 1n+q)) == Done{m} : Result<&2, &2, M.CmError, B.Octets>} %Equal.sym(Nat, Nat.mod(1n+Nat.add(B.Octets.len(m), p1), 1n+q), 0n, hm) : {pk.ug(1n+q, B.Octets.append(m, pk.pad(p1)), 1n+Nat.add(B.Octets.len(m), p1), _) == Done{m} : Result<&2, &2, M.CmError, B.Octets>} pk.oct(1n+q, m, p1, hle, pk.le_trans(1n+p1, 1n+q, 255n)(hle)(hb)) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le 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=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.append 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-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/PROOF.bend&name=pk.le_trans https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/PROOF.bend&name=pk.len https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/PROOF.bend&name=pk.oct https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/PROOF.bend&name=pk.pad https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/PROOF.bend&name=pk.ug https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/pkcs7.bend&name=Pkcs7.unpad.go