[OTR-dev] Fingerprints?

Ian Goldberg ian at cypherpunks.ca
Wed Jan 19 09:39:11 EST 2005


On Wed, Jan 19, 2005 at 08:08:11AM -0500, alex323 wrote:
> "What the above is saying is that you need
> to encode it as 00000003123456, not 0000000400123456 or any other
> such thing."
> 
> Why wouldn't it be encoded as 6123456?
> 
> 0x00123456 == 0x123456 == (len = 6) == 0x0006123456 == 0x6123456
> 
> ^^ Right? ^^

No.  The length of 0x123456 is 3 bytes: 0x12, 0x34, 0x56.

*First* remove any leading 0x00 bytes from the MPI.
*Next* find the resulting length of the (possibly shorter) MPI, in bytes.
*Finally*, output the length (as a four-byte value), followed by that
           many bytes of MPI data.

The result will almost certainly have leading 0x00 bytes, but only in
the length field, which is probably smaller than 0x01000000.

   - Ian



More information about the OTR-dev mailing list