Hi,
 
First, according to 10.5.7.4, "2560 - 0" will be encoded as "0a 00".
That is 2 byte long.
 
Second, according to 12.2.6, the count of the number of octets to represent
the range of (0..4294967295) is 4. In other words, "lb" is 1, and "ub" is
4. Therefore the length of length determinant is 2 bits long.
 
Since the result of "2 - 1" is 1, the encoding of length determinant is "01".
Note that you need aligned encoding, so "01" is padded to 8 bits long. That
is "01000000"(0x40). So the complete encoding of your example is "40 0a 00" 
 
 
Author Name: Wang Hao
Phone:+86-755-89650628
EMail:[EMAIL PROTECTED]
*****************************************************************
This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
*****************************************************************
----- Original Message -----
Sent: Monday, October 18, 2004 10:50 PM
Subject: [ASN1] PER encoding

Hi
 
Please help me out?
 
In PER (aligned)encoding of Constrained Integer Types, how the following is encoded.
 
integer1 INTEGER (0..4294967295) :: 2560
 
How many bits are used to represent the length?
 
In general, how to know the number of bits if the range is greater than 0xffffffff??
 
Please verify whether this is correct or not?
 
I saw the decoding of 2560 as 40 0a 00.
 
But 40 is 0100 0000 .
 
If the first 3 bits(I assumed it thinking that the number will not be greater than 8 bytes...Is this correct or not??) represent the length field of the integer, 010 is 2 and
 
since it is an offset from 1 ,the length of that integer will be 2+1=3 bytes.
 
Is that 3 bytes are 40 0a and 00 OR 0a 00 and the next byte.
 
Please provide me the aligned PER decoding for 2560 with the range (0..4294967295).
 
 
Regards
Santosh


All the news that matters. All the gossip from home. Specially for NRIs!


_______________________________________________
ASN1 mailing list
[EMAIL PROTECTED]
http://lists.asn1.org/mailman/listinfo/asn1
_______________________________________________
ASN1 mailing list
[EMAIL PROTECTED]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to