Exemple #1
0
 public void HMACRIPEMD160_d(string testName, HMACRIPEMD160 hmac, byte[] input, byte[] result)
 {
     hmac.TransformFinalBlock(input, 0, input.Length);
     Assert.AreEqual(result, hmac.Hash, testName + ".d");
     // required or next operation will still return old hash
     hmac.Initialize();
 }
Exemple #2
0
 public void HMACRIPEMD160_e(string testName, HMACRIPEMD160 hmac, byte[] input, byte[] result)
 {
     byte[] copy = new byte [input.Length];
     for (int i = 0; i < input.Length - 1; i++)
     {
         hmac.TransformBlock(input, i, 1, copy, i);
     }
     hmac.TransformFinalBlock(input, input.Length - 1, 1);
     Assert.AreEqual(result, hmac.Hash, testName + ".e");
     // required or next operation will still return old hash
     hmac.Initialize();
 }