ietf-openpgp
[Top] [All Lists]

2 octet length determination

2000-10-27 01:47:21
To all,

After a lot of "wondering" about how to write a version 4 two octet length, I thought it would be nice to post this for a two octet length (192 to 8383 octets):

let a  = (total data packet length) - 192

let bc = two octet representation of a

let d = b + 192

From this, the two octet value to write is equal to dc.

Nice and easy :)

2440bis/4.2.2.2 tells you how to determine that packet length from a two octet length, however it does not tell you how to code the two octet length packet and it may be worth adding the above simplified formula for us dummies.


Erron Criddle
Comasp Ltd.
Level 2, 45 Stirling Hwy
NEDLANDS  WA  6009
Australia

Fax: +61 8 9386 9473
Tel: + 61 8 9386 9534

http://www.comasp.com
ejc(_at_)comasp(_dot_)com












<Prev in Thread] Current Thread [Next in Thread>
  • 2 octet length determination, Erron Criddle <=