Inheritance: System.Security.Cryptography.HashAlgorithm
Exemplo n.º 1
0
 public void ComputeHash1()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     var input = ASCIIEncoding.ASCII.GetBytes("a");
     var expeceted = new byte[] { 0x0b, 0xdc, 0x9d, 0x2d, 0x25, 0x6b, 0x3e, 0xe9, 0xda, 0xae, 0x34, 0x7b, 0xe6, 0xf4, 0xdc, 0x83, 0x5a, 0x46, 0x7f, 0xfe };
     var output = target.ComputeHash(input);
     Assert.IsTrue(output.SequenceEqual(expeceted));
 }
Exemplo n.º 2
0
 public void ComputeHash2()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     var input = ASCIIEncoding.ASCII.GetBytes("abc");
     var expeceted = new byte[] { 0x8e, 0xb2, 0x08, 0xf7, 0xe0, 0x5d, 0x98, 0x7a, 0x9b, 0x04, 0x4a, 0x8e, 0x98, 0xc6, 0xb0, 0x87, 0xf1, 0x5a, 0x0b, 0xfc };
     var output = target.ComputeHash(input);
     Assert.IsTrue(output.SequenceEqual(expeceted));
 }
Exemplo n.º 3
0
 public void HashSizeTest()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     Assert.AreEqual(target.HashSize, 160);
 }
Exemplo n.º 4
0
 public void OutputBlockSizeTest()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     Assert.AreEqual(target.OutputBlockSize, 64);
 }
Exemplo n.º 5
0
 public void CanTransformMultipleBlocksTest()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     Assert.IsTrue(target.CanTransformMultipleBlocks);
 }
Exemplo n.º 6
0
 public void CanReuseTransformTest()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     Assert.IsTrue(target.CanReuseTransform);
 }
Exemplo n.º 7
0
 public void InitializeTest()
 {
     RIPEMD160Hash target = new RIPEMD160Hash(); // TODO: Initialize to an appropriate value
     target.Initialize();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Exemplo n.º 8
0
 public void RIPEMD160HashConstructorTest()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 9
0
 public void ComputeHash3()
 {
     RIPEMD160Hash target = new RIPEMD160Hash();
     var input = ASCIIEncoding.ASCII.GetBytes("message digest");
     var expeceted = new byte[] { 0x5d, 0x06, 0x89, 0xef, 0x49, 0xd2, 0xfa, 0xe5, 0x72, 0xb8, 0x81, 0xb1, 0x23, 0xa8, 0x5f, 0xfa, 0x21, 0x59, 0x5f, 0x36 };
     var output = target.ComputeHash(input);
     Assert.IsTrue(output.SequenceEqual(expeceted));
 }