ietf-smime
[Top] [All Lists]

Re: CMS: Comment on checksum algorithm.

1998-11-14 17:39:38
Dr Stephen Henson <shenson(_at_)drh-consultancy(_dot_)demon(_dot_)co(_dot_)uk> 
writes:
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.
It might be ambiguous, but so is 'first to last', IMHO.

How about 
'most significant (leftmost) to least significant (rightmost) octet'

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?
It certainly looks like it to me.

-Ekr

-- 
[Eric Rescorla                                   ekr(_at_)rtfm(_dot_)com]

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