Pkcs7.pkcs7.pad.oct: def of bend-osdev-pkcs7@0.1.0.0 Import: import bend-osdev-pkcs7@0.1.0.0/pkcs7.bend as Pkcs7 Lines 20-25 of bend-osdev-pkcs7@0.1.0.0/pkcs7.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-pkcs7@0.1.0.0/pkcs7.bend&start_line=20&end_line=25 import Base import bend-osdev-bytes@0.1.1.0/bytes.bend as B # m and its padding (on Octets, so that a long message is not walked as a # list: Bend 2.0.37's runtime overflows its stack on deep structural # recursion) def pkcs7.pad.oct(+bs: Nat, +m: B.Octets) -> B.Octets: +p = Nat.sub(bs, Nat.mod(B.Octets.len(m), bs)) B.Octets.append(m, B.Octets.of_list(pkcs7.fill(p, U32.from_nat(p)))) Uses (9): 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=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat 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-bytes@0.1.1.0/bytes.bend&name=Octets.of_list https://jend.leeeet.dev/definition.txt?path=bend-osdev-pkcs7@0.1.0.0/pkcs7.bend&name=pkcs7.fill