I am reading "ASN.1 Communication between Heterogeneous Systems" by Dr.
Olivier Dubuisson, and noticed this in Section 20.4 (pp. 437) "if d >=
65,537, (n-b_min) is encoded on the minimal number of octets (which are
octet-aligned) necessary for representing the *interval range* d, i.e.
$\lceil log_256(d) \rceil$ octets; this number of octets is encoded
beforehand in a length field L as a constrained whole number."
Does the above statement conflict with Clause 10.5 of X.691-0207,
"Encoding of a constrained whole number", where it states: "Where the
range is greater than 64K, the range is ignored and the value encodes
into an octet-aligned bit-field which is the minimum number of octets
for the *value*. "
(Dubuisson's book says the range, while X.691 says the value.)
I'll have an answer later.
Another related question that confuses me is that, when I use
http://asn1-playground.oss.com/ to test encoding of the following simple
example:
World-Schema DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
TESTTYPE ::= INTEGER (1..65538)
END
testvalue TESTTYPE ::= 8
Under PER ALIGNED, testvalue is encoded as 0007
In this example, where is the length determinant in the encoded result?
The length determinant is in the first two bits.
0000 0000
00xx xxxx length 0 means length = 1 octet
xx00 0000 padding
Try encoding 65538 and you'll see!
_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1