ietf-smime
[Top] [All Lists]

CMS: Comment on checksum algorithm.

1998-11-14 16:34:00
Couple of comments re the checksum algorithm:

12.6.1  Sum of Sums Key Checksum

   The Sum of Sums [SUM] key checksum algorithm is:

   1.  Initialize two 16 bit integers, sum1 and sum2, to zero.
   2.  Loop through the octets of the content-encryption key, most
       significant octet to least significant octet.
       2a.  Create a 16 bit integer, called temp, by concatenating
            eight zero bits and the key octet.
       2b.  sum1 = sum1 + temp.
       2c.  sum2 = sum2 + sum1.
   3.  Use sum2 as the checksum value.


IMHO "most significant octet to least significant octet" might be
considered ambiguous. Perhaps "first to last octet" (assuming that's
what it means) would be clearer.

I assume 2a this is just setting temp to the value of the key octet
(i.e. treat key octet as an unsigned 8 bit integer).

Finally isn't the whole thing equivalent to:

{n*K_1 + (n-1)*K_2 + ... + K_n} mod 2^16

Where an K_i represents the i'th octet of an n byte key? Or am I
misinterpreting something?

Steve.
-- 
Dr Stephen N. Henson. UK based freelance Cryptographic Consultant. 
For info see homepage at http://www.drh-consultancy.demon.co.uk/
Email: shenson(_at_)drh-consultancy(_dot_)demon(_dot_)co(_dot_)uk
PGP key: via homepage.


<Prev in Thread] Current Thread [Next in Thread>