~/bend-docscommunity

conform.bend checks

raw source on the hub · import 0xeb25eff332574f4f1d48668b83cdda30/conform.bend as Conform

bend-osdev-asn1, what rules accept of a value: each universal element in the form the rules require (rules.bend), and each SET's elements in the rules' order: for the SET OF order, the encodings ascending as octet strings, the shorter padded at its end with zero octets (ITU-T X.690 (02/2021) 11.6, comparing as 6.3 does); for the SET order, the tags ascending in X.680 (02/2021) 8.6's canonical order (X.690 10.3).

Asn1.conforms(r, n) is what the decoder checks of each element it builds, so a value the encoder writes is decoded back under rules r exactly when it conforms to r (LAWS.bend: decode_encode).

6 imports
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import ./tag.bend as T
import ./rules.bend as R
import ./node.bend as N
import ./encode.bend as En

Definitions

def a1.zeros_only source · line 18 · raw

@xs:List<&2, U32> -> Bool

def a1.lex source · line 25 · raw

@c:Cmp -> @rest:Bool -> Bool

def a1.le_pad source · line 35 · raw

@xs:List<&2, U32> -> @ys:List<&2, U32> -> Bool

xs <= ys as octet strings, the shorter padded with zero octets (11.6)

def a1.ordered source · line 45 · raw

@o:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1SetOrder -> @a:0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node -> @b:0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node -> Bool

whether a may come before b in a SET under order o

def a1.sorted.go source · line 54 · raw

@xs:List<&2, 0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node> -> @+o:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1SetOrder -> @prev:0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node -> Bool

def a1.sorted source · line 62 · raw

@+o:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1SetOrder -> @xs:List<&2, 0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node> -> Bool

elements in order o, each against the next

def a1.set_ok.pick source · line 69 · raw

@is_set:Bool -> @+r:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1Rules -> @xs:List<&2, 0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node> -> Bool

def a1.set_ok source · line 78 · raw

@+r:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1Rules -> @t:0xeb25eff332574f4f1d48668b83cdda30/tag.Asn1Tag -> @xs:List<&2, 0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node> -> Bool

a constructed element's elements in the order its rules require (only [UNIVERSAL 17], SET and SET OF, has one)

def a1.conf_list source · line 86 · raw

@ns:List<&2, 0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node> -> @+r:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1Rules -> Bool

whether rules r accept every element of ns (form and SET order)

def Asn1.conforms source · line 95 · raw

@+r:0xeb25eff332574f4f1d48668b83cdda30/rules.Asn1Rules -> @n:0xeb25eff332574f4f1d48668b83cdda30/node.Asn1Node -> Bool