public static bool VerifySignature(uint256 message, UnblindedSignature signature, PubKey signerPubKey) { var P = signerPubKey.ECKey.GetPublicKeyParameters().Q; var sG = Secp256k1.G.Multiply(signature.S); var cP = P.Multiply(signature.C); var R = cP.Add(sG).Normalize(); var t = R.AffineXCoord.ToBigInteger().Mod(Secp256k1.N); var c = new BigInteger(1, Hashes.SHA256(message.ToBytes(false).Concat(Utils.BigIntegerToBytes(t, 32)))); return(c.Equals(signature.C)); }
public bool VerifyUnblindedSignature(UnblindedSignature signature, byte[] data) { var hash = new uint256(Hashes.SHA256(data)); return(SchnorrBlinding.VerifySignature(hash, signature, Key.PubKey)); }
public bool VerifyUnblindedSignature(UnblindedSignature signature, uint256 dataHash) { return(SchnorrBlinding.VerifySignature(dataHash, signature, Key.PubKey)); }