public void RFC1320_d(string testName, MD4 hash, byte[] input, byte[] result) { byte[] output = hash.TransformFinalBlock(input, 0, input.Length); AssertEquals(testName + ".d.1", input, output); AssertEquals(testName + ".d.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize(); }
public void RFC1320_b(string testName, MD4 hash, byte[] input, byte[] result) { byte[] output = hash.ComputeHash(input, 0, input.Length); AssertEquals(testName + ".b.1", result, output); AssertEquals(testName + ".b.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize(); }
public void RFC1320_c(string testName, MD4 hash, byte[] input, byte[] result) { MemoryStream ms = new MemoryStream(input); byte[] output = hash.ComputeHash(ms); AssertEquals(testName + ".c.1", result, output); AssertEquals(testName + ".c.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize(); }
public void RFC1320_e(string testName, MD4 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); } byte[] output = hash.TransformFinalBlock(input, input.Length - 1, 1); AssertEquals(testName + ".e.1", input [input.Length - 1], output [0]); AssertEquals(testName + ".e.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize(); }