private static byte[] DoHash(uint[] x) { uint num1 = 1732584193; uint num2 = 4023233417; uint num3 = 2562383102; uint num4 = 271733878; uint num5 = 3285377520; for (int index1 = 0; index1 < x.Length / 16; ++index1) { uint num6 = num1; uint num7 = num1; uint x1 = num2; uint x2 = num2; uint y1 = num3; uint y2 = num3; uint z1 = num4; uint z2 = num4; uint num8 = num5; uint num9 = num5; for (int index2 = 0; index2 < 80; ++index2) { int j1 = index2 / 16; byte num10 = Ripemd160Manager.R[index2]; uint num11 = Ripemd160Manager.K[j1]; uint num12 = x[index1 * 16 + (int)num10]; byte shift1 = Ripemd160Manager.S[index2]; int num13 = (int)Ripemd160Manager.Rol(num6 + Ripemd160Manager.F(j1, x1, y1, z1) + num12 + num11, shift1) + (int)num8; num6 = num8; num8 = z1; z1 = Ripemd160Manager.Rol(y1, (byte)10); y1 = x1; x1 = (uint)num13; int j2 = 4 - j1; byte num14 = Ripemd160Manager.R1[index2]; uint num15 = Ripemd160Manager.K1[j1]; uint num16 = x[index1 * 16 + (int)num14]; byte shift2 = Ripemd160Manager.S1[index2]; int num17 = (int)Ripemd160Manager.Rol(num7 + Ripemd160Manager.F(j2, x2, y2, z2) + num16 + num15, shift2) + (int)num9; num7 = num9; num9 = z2; z2 = Ripemd160Manager.Rol(y2, (byte)10); y2 = x2; x2 = (uint)num17; } int num18 = (int)num2 + (int)y1 + (int)z2; num2 = num3 + z1 + num9; num3 = num4 + num8 + num7; num4 = num5 + num6 + x2; num5 = num1 + x1 + y2; num1 = (uint)num18; } byte[] numArray = new byte[20]; Buffer.BlockCopy((Array)BitConverter.GetBytes(num1), 0, (Array)numArray, 0, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes(num2), 0, (Array)numArray, 4, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes(num3), 0, (Array)numArray, 8, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes(num4), 0, (Array)numArray, 12, 4); Buffer.BlockCopy((Array)BitConverter.GetBytes(num5), 0, (Array)numArray, 16, 4); return(numArray); }
public static byte[] GetHash(byte[] data) { int num1 = 72; int num2 = data.Length % 64; if (num2 > 56) { num1 = 128 - num2; } else if (num2 < 56) { num1 = 64 - num2; } uint[] x = new uint[(data.Length + num1) / 4]; Buffer.BlockCopy((Array)data, 0, (Array)x, 0, data.Length); x[data.Length / 4] |= (uint)(1 << 8 * (data.Length % 4) + 7); x[x.Length - 2] = (uint)(data.Length << 3); x[x.Length - 1] = (uint)data.Length >> 29; return(Ripemd160Manager.DoHash(x)); }