Remove Hash, Hash256, Hash160 and ScryptHash256 classes.
[NovacoinLibrary.git] / Novacoin / ScriptCode.cs
index df1d773..ab0db3f 100644 (file)
@@ -656,7 +656,7 @@ namespace Novacoin
         /// <param name="nIn">Input number</param>
         /// <param name="nHashType">Hash type flag</param>
         /// <returns></returns>
-        public static Hash256 SignatureHash(CScript script, CTransaction txTo, int nIn, int nHashType)
+        public static uint256 SignatureHash(CScript script, CTransaction txTo, int nIn, int nHashType)
         {
             Contract.Requires<ArgumentOutOfRangeException>(nIn < txTo.vin.Length, "nIn out of range.");
 
@@ -727,7 +727,7 @@ namespace Novacoin
             var txBytes = (byte[])txTmp;
             var nHashTypeBytes = BitConverter.GetBytes(nHashType);
 
-            return Hash256.Compute256(ref txBytes, ref nHashTypeBytes);
+            return CryptoUtils.ComputeHash256(ref txBytes, ref nHashTypeBytes);
         }
 
         //
@@ -1492,25 +1492,25 @@ namespace Novacoin
                                     {
                                         return false;
                                     }
-                                    Hash hash = null;
+                                    byte[] hash = null;
                                     var data = stacktop(ref stack, -1);
 
                                     switch (opcode)
                                     {
                                         case instruction.OP_HASH160:
-                                            hash = Hash160.Compute160(data);
+                                            hash = CryptoUtils.ComputeHash160(data);
                                             break;
                                         case instruction.OP_HASH256:
-                                            hash = Hash256.Compute256(data);
+                                            hash = CryptoUtils.ComputeHash256(data);
                                             break;
                                         case instruction.OP_SHA1:
-                                            hash = SHA1.Compute1(data);
+                                            hash = CryptoUtils.ComputeSha1(data);
                                             break;
                                         case instruction.OP_SHA256:
-                                            hash = SHA256.Compute256(data);
+                                            hash = CryptoUtils.ComputeSha256(data);
                                             break;
                                         case instruction.OP_RIPEMD160:
-                                            hash = RIPEMD160.Compute160(data);
+                                            hash = CryptoUtils.ComputeRipeMD160(data);
                                             break;
                                     }
                                     popstack(ref stack);