MD5 implementation notes

Posted by vaasu on Programmers See other posts from Programmers or by vaasu
Published on 2011-07-05T09:57:00Z Indexed on 2012/06/16 15:22 UTC
Read the original article Hit count: 683

Filed under:

While going through RFC1321, I came across the following paragraph:

   This step uses a 64-element table T[1 ... 64] constructed from the
   sine function. Let T[i] denote the i-th element of the table, which
   is equal to the integer part of 4294967296 times abs(sin(i)), where i
   is in radians. The elements of the table are given in the appendix.

From what I understood from paragraph, it means

T[i] = Integer_part(4294967296 times abs(sin(i)))

We know the following is true for all x:

0 <= sin(x) <= 1

Since i is an integer, abs(sin(i)) may very well be 0 for all values of i.

That means table will contain all zero values ( 4294967296 times 0 is 0). In the implementation, this is not true. Why is this so?
Appendix contains just the raw values after calculation. It does not show how it is derived from the sine function.

© Programmers or respective owner

Related posts about cryptography