/******************************************************** * TRANSFORMATIONS : FF , GG , HH , II acc to RFC 1321 * where each Each letter represnets the aux function used *********************************************************/ /// <summary> /// perform transformatio using f(((b&c) | (~(b)&d)) /// </summary> public void TransF(ref uint a, uint b, uint c, uint d, uint k, ushort s, uint i) { //0:31ms TransF enter { a = 1298439783, b = 3640036287, c = 4287987886, d = 1158240751, k = 15, s = 22, i = 16 } view-source:36394 //0:31ms TransF exit { a = 3230906716, b = 3640036287, c = 4287987886, d = 1158240751, k = 15, s = 22, i = 16 } view-source:36394 //0:32ms PerformTransformation exit { AA = 1732584193, A = 1676787624, AAA = 3409371817 } //TransF enter { a = 1298439783, b = 3640036287, c = 4287987886, d = 1158240751, k = 15, s = 22, i = 16 } //TransF exit { a = 3063134556, b = 3640036287, c = 4287987886, d = 1158240751, k = 15, s = 22, i = 16 } //PerformTransformation exit { AA = 1732584193, A = 3271237212, AAA = 708854109 } // ref$b[0] = (c + ZAAABlo95zeSv7E3WiwqXw((((ref$b[0] + ((((c & d) >>> 0) | ((~c & e) >>> 0)) >>> 0)) + a[0].X[(~~f)]) + DwAABCsrrziddgpvRTLKgg[(~~(h - 1))]), g)); var X_k = X[k]; Console.WriteLine( "TransF enter " + new { a, b, c, d, k, s, i, X_k } ); var T_i = T[i - 1]; var b_c = (b & c); var b_d = (~(b) & d); var b_c_b_d = b_c | b_d; // ((((ref$b[0] + m) + i) + j) & 0xffffffff) >>> 0 // X:\jsc.svn\examples\javascript\test\TestUInt32AddOvf\TestUInt32AddOvf\Application.cs var uiNumber = a + b_c_b_d + X_k + T_i; a = b + MD5Helper.RotateLeft( uiNumber, s ); Console.WriteLine( "TransF exit " + new { a, b, c, d, k, s, i } ); }
/// <summary> /// perform transformatio using i (c^(b|~d)) /// </summary> protected void TransI(ref uint a, uint b, uint c, uint d, uint k, ushort s, uint i) { a = b + MD5Helper.RotateLeft((a + (c ^ (b | ~d)) + X[k] + T[i - 1]), s); }
/******************************************************** * TRANSFORMATIONS : FF , GG , HH , II acc to RFC 1321 * where each Each letter represnets the aux function used *********************************************************/ /// <summary> /// perform transformatio using f(((b&c) | (~(b)&d)) /// </summary> protected void TransF(ref uint a, uint b, uint c, uint d, uint k, ushort s, uint i) { a = b + MD5Helper.RotateLeft((a + ((b & c) | (~(b) & d)) + X[k] + T[i - 1]), s); }
protected void TransI(ref uint a, uint b, uint c, uint d, uint k, ushort s, uint i) { a = b + MD5Helper.RotateLeft(a + (c ^ (b | ~d)) + this.X[(int)k] + MD5.T[(int)(i - 1u)], s); }