Пример #1
0
		public void RFC1319_e (string testName, MD2 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 ();
		}
Пример #2
0
		public void RFC1319_d (string testName, MD2 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 ();
		}