Patent ID: 6829355
Filing Date: 2004-12-07
Classification: H04L

Abstract:
A method of generating a hash value for a message of length l, comprising the steps of:a) padding the message to a length of 512m bits, where m is a user-definable positive integer; b) parsing the result of step (a) into 16 32m-bit blocks Mn; c) generating j values Wj from the result of step (b) according to the following equations: Wj=Mj for j=0,1, . . . , 15; and Wj=&sgr;1(Wjâˆ’2)+Wjâˆ’7+&sgr;0(Wjâˆ’15)+Wjâˆ’16 for j=16,17, . . . , j, where j is a user-definable positive integer; where &sgr;1(x)=S17(x)âŠ•S19(x)âŠ•R10(x), if m=1; where &sgr;1(x)=S19(x)âŠ•S61(x)âŠ•R6(x), if m=2; where + is addition mod 232m; where âŠ• is bitwise XOR; where &sgr;0(x)=S7(x)âŠ•S18(x)âŠ•R3(x), if m=1; where &sgr;0(x)=S1(x)âŠ•S8(x)âŠ•R7(x), if m=2; where S1(x) is a right rotation of block x by i bits, leaving block x unchanged afterwards; and where R1(x) is a right shift of block x by i bits, leaving block x unchanged afterwards; d) initializing a, b, c, d, e, f, g, and h with user-definable values H1, H2, H3, H4, H5, H6, H7, and H8, respectively; e) converting a, b, c, d, e, f, g, and h as follows: hj=gjâˆ’1; gj=fjâˆ’1; fj=ejâˆ’1; ej=djâˆ’1+T1, where T1=hjâˆ’1+&Sgr;1(ejâˆ’1)+Ch(ejâˆ’1, fjâˆ’1, gjâˆ’1)+Kj+Wj, where &Sgr;1(ejâˆ’1)=S6(ejâˆ’1)âŠ•S11(ejâˆ’1)âŠ•S25(ejâˆ’1) if m=1; where &Sgr;1(ejâˆ’1)=S14(ejâˆ’1)âŠ•S18(ejâˆ’1)âŠ•S41(ejâˆ’1) if m=2; where Ch(ejâˆ’1, fjâˆ’1, gjâˆ’1)=(ejâˆ’1&Hat;fjâˆ’1)âŠ•(ejâˆ’1&Hat;gjâˆ’1); where Kj is at least one key; where &Hat; is bitwise AND, and where  is bitwise complement; dj=cjâˆ’1; cj=bjâˆ’1; bj=ajâˆ’1; and aj=T1+T2, where T2=&Sgr;0(ajâˆ’1)+Maj(ajâˆ’1, bjâˆ’1, cjâˆ’1); where &Sgr;0(ajâˆ’1)=S2(ajâˆ’1)âŠ•S13(ajâˆ’1)âŠ•S22(ajâˆ’1) for m=1; where &Sgr;0(ajâˆ’1)=S28(ajâˆ’1)âŠ•S34(ajâˆ’1)âŠ•S39(ajâˆ’1) for m=2; and where Maj(ajâˆ’1, bjâˆ’1, cjâˆ’1)=(ajâˆ’1&Hat;bjâˆ’1)âŠ•(ajâˆ’1&Hat;cjâˆ’1)âŠ•(bjâˆ’1&Hat;cjâˆ’1); f) computing values as follows: H1(j)=a+H1(jâˆ’1); H2(j)=b+H2(jâˆ’1); H3(j)=c+H3(jâˆ’1); H4(j)=d+H4(jâˆ’1); H5(j)=e+H5(jâˆ’1); H6(j)=f+H6(jâˆ’1); H7(j)=g+H7(jâˆ’1); and H8(j)=h+H8(jâˆ’1); and g) returning to step (f) if additional processing is desired, otherwise, returning at least 161 bits of (H1(j), H2(j), H3(j), H4(j), H5(j), H6(j), H7(j), H8(j)) as the hash value of the message.