proof_oid.bend checks
raw source on the hub · import 0xeb25eff332574f4f1d48668b83cdda30/proof_oid.bend as Proof_oid
Proofs for bend-osdev-asn1: OBJECT IDENTIFIER contents read back as the arcs written. Each subidentifier's base-128 octets read back as it and pass the fewest-octets check (proof_num.bend's pn.r128_b128), and the first subidentifier splits back into the first two arcs.
10 imports
import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import ./error.bend as E import ./number.bend as Nu import ./oidval.bend as O import ./proof_nat.bend as AN import ./proof_list.bend as AL import ./proof_u32.bend as AU import ./proof_num.bend as PN import ./proof_enc.bend as PE
Types
type PoNum source · line 148 · raw
Data
PoNum@bytes:List<&2, U32> -> @ok:Bool -> PoNum
type PoArcs source · line 151 · raw
Data
PoArcs@subids:List<&2, Nat> -> @ok:Bool -> PoArcs
Definitions
def po.b128_ne source · line 16 · raw
@+s:Nat -> {Nat.is_le(1n, List.length(&2, U32, 0xeb25eff332574f4f1d48668b83cdda30/number.a1.b128(s))) == True{} : Bool}
def po.len_subids source · line 20 · raw
@+s:Nat -> @+rest:List<&2, Nat> -> {List.length(&2, U32, 0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.subids(s <> rest)) == Nat.add(List.length(&2, U32, 0xeb25eff332574f4f1d48668b83cdda30/number.a1.b128(s)), List.length(&2, U32, 0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.subids(rest))) : Nat}
def po.one_ne source · line 23 · raw
@+s:Nat -> @xs:List<&2, U32> -> @m:Maybe<&2, List<&2, Nat>> -> @+h:{Nat.is_le(1n, List.length(&2, U32, xs)) == True{} : Bool} -> {0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.one(True{}, s, xs, m) == 0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.cons(s, m) : Maybe<&2, List<&2, Nat>>}
def po.read source · line 31 · raw
@ss:List<&2, Nat> -> @f:Nat -> @+hne:{Nat.is_le(1n, List.length(&2, Nat, ss)) == True{} : Bool} -> @+hf:{Nat.is_le(List.length(&2, U32, 0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.subids(ss)), f) == True{} : Bool} -> @+hsm:{0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.small(ss) == True{} : Bool} -> {0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.read(f, 0xeb25eff332574f4f1d48668b83cdda30/number.a1.r128(0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.subids(ss), True{}, 0xeb25eff332574f4f1d48668b83cdda30/number.a1.max_octets, 0n)) == Some{ss} : Maybe<&2, List<&2, Nat>>}the subidentifiers' octets read back as them
def po.fix_subids source · line 78 · raw
@ss:List<&2, Nat> -> {0x9df7f91779a4a1c215bfa96cd0864601/bytes.mask(0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.subids(ss)) == 0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.subids(ss) : List<&2, U32>}the subidentifiers' octets are masked
def po.split source · line 86 · raw
@x:Nat -> @+y:Nat -> @+rest:List<&2, Nat> -> @+hv:{0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.valid2(x, y) == True{} : Bool} -> {0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.arcs(Some{0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.to_subids(x <> y <> rest)}) == Done{x <> y <> rest} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>>}the first subidentifier splits back into the first two arcs
def po.disc source · line 107 · raw
@r:Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets> -> Type
def po.fd source · line 114 · raw
@-x:0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error -> @-y:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @e:{Fail{x} == Done{y} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>} -> Empty
def po.od source · line 118 · raw
@r:Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets> -> 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets
def po.rt source · line 125 · raw
@ok:Bool -> @arcs:List<&2, Nat> -> @-o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @+hv:{0xeb25eff332574f4f1d48668b83cdda30/oidval.Asn1.oid_valid(arcs) == ok : Bool} -> @+e:{0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.content.pick(ok, arcs) == Done{o} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>} -> {0xeb25eff332574f4f1d48668b83cdda30/oidval.Asn1.oid_of_content(o) == Done{arcs} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>>}
def po.nb source · line 154 · raw
@p:PoNum -> List<&2, U32>
def po.no source · line 159 · raw
@p:PoNum -> Bool
def po.ab source · line 164 · raw
@p:PoArcs -> List<&2, Nat>
def po.ao source · line 169 · raw
@p:PoArcs -> Bool
def po.pc source · line 174 · raw
@+y:U32 -> @p:PoNum -> PoNum
def po.mres source · line 180 · raw
@m:Maybe<&2, 0xeb25eff332574f4f1d48668b83cdda30/number.A1Num> -> @xs:List<&2, U32> -> @k:Nat -> Type
what a number read from xs (within k octets) says of xs
def po.mres_cons source · line 187 · raw
@+y:U32 -> @m:Maybe<&2, 0xeb25eff332574f4f1d48668b83cdda30/number.A1Num> -> @+t:List<&2, U32> -> @+j:Nat -> @h:po.mres(m, t, j) -> po.mres(0xeb25eff332574f4f1d48668b83cdda30/number.a1.num_cons(y, m), y <> t, 1n+j)
def po.r128_m source · line 195 · raw
@xs:List<&2, U32> -> @more:Bool -> @k:Nat -> @+acc:Nat -> po.mres(0xeb25eff332574f4f1d48668b83cdda30/number.a1.r128(xs, more, k, acc), xs, k)
def po.rres source · line 214 · raw
@m:Maybe<&2, List<&2, Nat>> -> @xs:List<&2, U32> -> Type
what subidentifiers read from xs say of xs
def po.one_m source · line 221 · raw
@ok:Bool -> @+s:Nat -> @+u:List<&2, U32> -> @rest:List<&2, U32> -> @more:Maybe<&2, List<&2, Nat>> -> @+xs:List<&2, U32> -> @+hok:{0xeb25eff332574f4f1d48668b83cdda30/number.a1.leq(0xeb25eff332574f4f1d48668b83cdda30/number.a1.b128(s), u) == ok : Bool} -> @+hm:{PoNum{List.append(&2, U32, u, rest), Nat.is_le(List.length(&2, U32, u), 6n)} == PoNum{xs, True{}} : PoNum} -> @ih:po.rres(more, rest) -> po.rres(0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.one(ok, s, rest, more), xs)
def po.read_m source · line 251 · raw
@f:Nat -> @m:Maybe<&2, 0xeb25eff332574f4f1d48668b83cdda30/number.A1Num> -> @+xs:List<&2, U32> -> @hm:po.mres(m, xs, 6n) -> po.rres(0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.read(f, m), xs)
def po.add_sub source · line 263 · raw
@+a:Nat -> @+b:Nat -> @+h:{Nat.is_le(a, b) == True{} : Bool} -> {Nat.add(a, Nat.sub(b, a)) == b : Nat}a <= b: a + (b - a) == b
def po.sub_lt source · line 274 · raw
@+s:Nat -> @+h:{Nat.is_lt(s, 80n) == True{} : Bool} -> @+g:{Nat.is_le(40n, s) == True{} : Bool} -> {Nat.is_lt(Nat.sub(s, 40n), 40n) == True{} : Bool}b <= s < b + 40 (b = 40): s - 40 < 40
def po.le_of_nlt source · line 278 · raw
@+a:Nat -> @+b:Nat -> @+h:{Nat.is_lt(a, b) == False{} : Bool} -> {Nat.is_le(b, a) == True{} : Bool}
def po.split_ok source · line 282 · raw
@lt40:Bool -> @lt80:Bool -> @+s:Nat -> @+rest:List<&2, Nat> -> @+h40:{Nat.is_lt(s, 40n) == lt40 : Bool} -> @+h80:{Nat.is_lt(s, 80n) == lt80 : Bool} -> {PoArcs{0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.to_subids(0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.split2(lt40, lt80, s, rest)), 0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.valid(0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.split2(lt40, lt80, s, rest))} == PoArcs{s <> rest, True{}} : PoArcs}the first subidentifier's split, folded back, and the arcs' validity
def po.rdisc source · line 297 · raw
@r:Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>> -> Type
def po.fd2 source · line 304 · raw
@-x:0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error -> @-y:List<&2, Nat> -> @e:{Fail{x} == Done{y} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>>} -> Empty
def po.rval source · line 308 · raw
@r:Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>> -> @d:List<&2, Nat> -> List<&2, Nat>
def po.canon_m source · line 315 · raw
@mr:Maybe<&2, List<&2, Nat>> -> @+xs:List<&2, U32> -> @-arcs:List<&2, Nat> -> @hr:po.rres(mr, xs) -> @+e:{0xeb25eff332574f4f1d48668b83cdda30/oidval.a1.oid.arcs(mr) == Done{arcs} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>>} -> {0xeb25eff332574f4f1d48668b83cdda30/oidval.Asn1.oid_content(arcs) == Done{0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets.of_list(xs)} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>}
def po.canonical source · line 339 · raw
@+o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @-arcs:List<&2, Nat> -> @+e:{0xeb25eff332574f4f1d48668b83cdda30/oidval.Asn1.oid_of_content(o) == Done{arcs} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, List<&2, Nat>>} -> {0xeb25eff332574f4f1d48668b83cdda30/oidval.Asn1.oid_content(arcs) == Done{o} : Result<&2, &2, 0xeb25eff332574f4f1d48668b83cdda30/error.Asn1Error, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>}contents read as arcs are the octets those arcs are written as