Merge pull request #2022 from wydengyre/bip-340-signing

schnorr: bip-340 compliant signing
This commit is contained in:
Olaoluwa Osuntokun 2023-08-15 15:30:33 -07:00 committed by GitHub
commit 40d7a0a06c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,10 +174,7 @@ func schnorrVerify(sig *Signature, hash []byte, pubKeyBytes []byte) error {
)
var e btcec.ModNScalar
if overflow := e.SetBytes((*[32]byte)(commitment)); overflow != 0 {
str := "hash of (r || P || m) too big"
return signatureError(ecdsa_schnorr.ErrSchnorrHashValue, str)
}
e.SetBytes((*[32]byte)(commitment))
// Negate e here so we can use AddNonConst below to subtract the s*G
// point from e*P.