X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=Novacoin%2FCKey.cs;h=672f0becbd26a5056bac35c308ac825d01f4c977;hb=1dcac5faa2b1477034f82466ffb16170fa2e9bb6;hp=a24d6c82a03a250615f0ab4ce9625c798711d26a;hpb=4426ee1dc8ae6733d46b5413d3bce28333792d22;p=NovacoinLibrary.git diff --git a/Novacoin/CKey.cs b/Novacoin/CKey.cs index a24d6c8..672f0be 100644 --- a/Novacoin/CKey.cs +++ b/Novacoin/CKey.cs @@ -71,7 +71,7 @@ namespace Novacoin return pubKeyParams; } - ECPoint q = new FpPoint(curve.Curve, pubKeyParams.Q.X, pubKeyParams.Q.Y, false); + var q = new FpPoint(curve.Curve, pubKeyParams.Q.X, pubKeyParams.Q.Y, false); return new ECPublicKeyParameters(q, domain); } @@ -82,13 +82,13 @@ namespace Novacoin /// Data hash /// Signature bytes /// Checking result - public bool VerifySignature(Hash sigHash, IEnumerable signature) + public bool VerifySignature(uint256 sigHash, byte[] signature) { - ISigner signer = SignerUtilities.GetSigner("NONEwithECDSA"); + var signer = SignerUtilities.GetSigner("NONEwithECDSA"); signer.Init(false, _Public); - signer.BlockUpdate(sigHash.hashBytes, 0, sigHash.hashSize); + signer.BlockUpdate(sigHash, 0, sigHash.Size); - return signer.VerifySignature(signature.ToArray()); + return signer.VerifySignature(signature); } /// @@ -97,15 +97,7 @@ namespace Novacoin /// New key ID public CKeyID KeyID { - get { return new CKeyID(Hash160.Compute160(PublicBytes)); } - } - - /// - /// PublicBytes part of key pair - /// - public IEnumerable PublicBytes - { - get { return _Public.Q.GetEncoded(); } + get { return new CKeyID(CryptoUtils.ComputeHash160(_Public.Q.GetEncoded())); } } ///