for   NANE   OCTET STRING (SIZE (1 ... 8192)), how should I decode the
received bit stream?

We are using PER unaligned.

The first 13 bits are used for the length field. There are only 8192 possible lengths and we can represent all possible states in 13 bits. The length is transformed by adding 1. Thus a length field containing all zeroes really signifies a length of 1, and a length field containing the least significant 13 bits of 0x1FFF (all ones) signifies 8192. Immediately thereafter (without padding) come the octets of the OCTET STRING. By way of example

00088910 in hex

00000000 00001000 10001001 00010000 in bits
00000000 00001xxx xxxxxxxx xxxxxxxx length (1 --> 2)
xxxxxxxx xxxxx000 10001001 00010xxx octets '1122'H
xxxxxxxx xxxxxxxx xxxxxxxx xxxxx000 padding

Note that the padding at the end is only shown so that I can easily represent the encoding in hexadecimal. If there were more data following the OCTET STRING, it would start where the padding start.

Also note that the encoding doesn't necessarily start on an octet boundary unless it's the first element in the encoding. If it followed another encoding, it would begin where the previous one ended.

=====================================================================
Conrad Sigona                    Voice Mail     : 1-732-302-9669 x400
OSS Nokalva                      Fax            : 1-614-388-4156
[EMAIL PROTECTED]                   My direct line : 1-315-845-1773
_______________________________________________
ASN1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to