Esempio n. 1
0
 /// <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);
 }
Esempio n. 2
0
        /********************************************************
         * 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);
        }
Esempio n. 3
0
 public override string ToString()
 {
     return(MD5Helper.ReverseByte(this.A).ToString("X8") + MD5Helper.ReverseByte(this.B).ToString("X8") + MD5Helper.ReverseByte(this.C).ToString("X8") + MD5Helper.ReverseByte(this.D).ToString("X8"));
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
        /********************************************************
         * 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 }
                );

            //int321 = MD5Type.T[(uint((i -1)))];
            //int322 = (b & c);
            //int323 = ((~b) & d);
            //int324 = (int322 | int323);
            //int325 = (((ref_arg1[0] + int324) + int320) + int321);
            //ref_arg1[0] = (b + MD5Helper.RotateLeft_df02d3dd_06000020(int325, s));

            var T_i = T[i - 1];

            //Console.WriteLine("TransF " + new { T_i });

            var b_c = (b & c);

            //Console.WriteLine("TransF " + new { b_c });

            var b_d = (~(b) & d);

            //Console.WriteLine("TransF " + new { b_d });

            var b_c_b_d = b_c | b_d;

            //Console.WriteLine("TransF " + new { 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;

            Console.WriteLine("TransF " + new { uiNumber });

            a = b + MD5Helper.RotateLeft(
                uiNumber,
                s
                );



            Console.WriteLine(
                "TransF exit " +
                new { a, b, c, d, k, s, i }
                );
        }