Subject: 5.5.3 clarification

From: Erron Criddle <[email-masked]>
Date: Mon, 06 Nov 2000 14:44:19 +0800

To all,

Regarding the 2 octet checksum (that is encrypted), how do we encrypt:

encrypt (Secret MPI's) + encrypt (2 octet checksum)

or:

encrypt (Secret MPI's + 2 octet checksum)

Also, I am also assuming a 16 bit checksum is:

16 bit checksum = 16 most significant bits (sum of Secret MPI's ASCII 
values MOD 65536)

this also assumes a big endian system.

Clarification on this would be great as 5.5.3 does not specify either of 
the above.

TIA.

Regards

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
[email-masked]

---

From: [email-masked]
Date: Mon, 6 Nov 2000 00:12:16 -0800

> encrypt (Secret MPI's + 2 octet checksum)

I'm not sure what distinction you are trying to draw here.  Presumably
"+" refers to concatenation?  With CFB mode you have the effect of a
stream cipher, hence there is no difference between encrypt(a+b) and
encrypt(a)+encrypt(b).

> 16 bit checksum = 16 most significant bits (sum of Secret MPI's ASCII 

I'm not sure what you mean by the 16 "most significant" bits of a value
which is mod 2^16.  That's just a 16 bit value.

These are not ASCII characters (ASCII is a mapping between typographic
symbols like letters, and binary values).  They are simple binary octets.

> this also assumes a big endian system.

Yes, the 16 bit value is taken in big endian form, i.e. high byte,
then low byte.  This is the general convention in OpenPGP, as noted in
section 3.1.

Hal Finney

---

From: "Michael Young" <[email-masked]>
Date: Mon, 6 Nov 2000 10:47:45 -0500

>Regarding the 2 octet checksum (that is encrypted), how do we encrypt:

If you're asking whether there is a CFB resync before the checksum, then
the answer is no.

Perhaps Hal would be willing to change the wording to something like:

    With V4 keys, a simpler method is used.  All secret MPI values 
    (including their MPI bitcount prefixes) and the checksum are
    encrypted in CFB mode, without any resynchronization.

>16 bit checksum = 16 most significant bits (sum of Secret MPI's ASCII 

Actually, it's mod 2^16, which means the *least* significant bits.
It's raw binary data; there is no character set involved.
The description of the checksum in the spec looks pretty airtight to me.

>this also assumes a big endian system.

The checksumming itself doesn't depend on the encoding system -- you're
adding individual octets (not 16-bit things).  The result is indeed
encoded most-significant-octet-first, like all other multi-octet numbers.