public void RIPEMD160_d(string testName, RIPEMD160 hash, byte[] input, byte[] result) { hash.TransformFinalBlock(input, 0, input.Length); AssertEquals(testName + ".d", result, hash.Hash); // required or next operation will still return old hash hash.Initialize(); }
public void RIPEMD160_e(string testName, RIPEMD160 hash, byte[] input, byte[] result) { byte[] copy = new byte [input.Length]; for (int i = 0; i < input.Length - 1; i++) { hash.TransformBlock(input, i, 1, copy, i); } hash.TransformFinalBlock(input, input.Length - 1, 1); AssertEquals(testName + ".e", result, hash.Hash); // required or next operation will still return old hash hash.Initialize(); }
/// <summary> /// Returns a byte array of the hash value. /// </summary> public byte[] Final() { ripemd160Provider.TransformFinalBlock(new byte[0], 0, 0); return(ripemd160Provider.Hash); }