mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-14 02:40:47 +02:00
always use fastsign option on btcec schnorr.
This commit is contained in:
parent
a546203758
commit
6f778f85ba
@ -42,7 +42,7 @@ func (evt Event) CheckSignature() (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sign signs an event with a given privateKey.
|
// Sign signs an event with a given privateKey.
|
||||||
func (evt *Event) Sign(secretKey string, signOpts ...schnorr.SignOption) error {
|
func (evt *Event) Sign(secretKey string) error {
|
||||||
s, err := hex.DecodeString(secretKey)
|
s, err := hex.DecodeString(secretKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Sign called with invalid secret key '%s': %w", secretKey, err)
|
return fmt.Errorf("Sign called with invalid secret key '%s': %w", secretKey, err)
|
||||||
@ -57,7 +57,7 @@ func (evt *Event) Sign(secretKey string, signOpts ...schnorr.SignOption) error {
|
|||||||
evt.PubKey = hex.EncodeToString(pkBytes[1:])
|
evt.PubKey = hex.EncodeToString(pkBytes[1:])
|
||||||
|
|
||||||
h := sha256.Sum256(evt.Serialize())
|
h := sha256.Sum256(evt.Serialize())
|
||||||
sig, err := schnorr.Sign(sk, h[:], signOpts...)
|
sig, err := schnorr.Sign(sk, h[:], schnorr.FastSign())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user