In PER Aligned Encoding of strings, is the length determinant padded so that the
string always starts off at a new byte.
myString IA5String(SIZE (1..128))(FROM ("0123456789No. *,"))
myString = 101
What will be the encoding for this?
This is my understanding from a packet capture:
I saw in the packet the encoding for it as follows:
------------- 01 00 43 42 --------------
i.e 0000 0001 0000 0000 0100 0011 0100 0010
The first two bits(00) are used as extension bit and representing choice value.
Since the string's size can be between 1 to 128, the number of bits used for
decoding length determinant is 7. Hence 00 0001 0 are used for finding length
determinant. That is , the length is equal to 3,(2 + 1).
The string yet to be read is 000 0000 0100 0011 0100 0010.
Will the string start from 0100 or 000?
Since the string can take values from "0123456789No. *,", i.e 13 values , 4 bits
will be used for encoding each character.
Say , is represented by 0,* by 1,. by 2,0 by 3,1 by 4, 2 by 5 and so on.
So, 101 can be represented as 434 i.e 0100 0011 0100.
If this is the case, what happens to the seven bits(Marked in Red) in 0000 0001
0000 0000 0100 0011 0100 0010.
Does it mean that for strings, the length determinant is padded for alignment.
Please explain if my understanding is wrong.
Your understanding is good as far as alignment goes. The string itself is
indeed aligned and those seven bits (my email reader doesn't show red) are
just padding. It's not good that you provided other stuff, like extension
bit and choice index, without showing us the accompanying ASN.1. Without
the ASN.1, we have to take your word for it, and a misunderstanding of the
initial bits could be the source of your difficulty.
But, given your FROM list, I don't see how 434 could be interpreted as
"101". It would have to be decoded as "0.0". The three half-octets 434
would have to instead be 545 to be decoded as "101". Please check that you
correctly transcribed the FROM.
If you'd like a more precise response, please send the encoding and all
the ASN.1 that reflects it.
=====================================================================
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