Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Navarro <[email protected]>
  • Loading branch information
ajnavarro committed Nov 7, 2023
1 parent 0e0f11d commit 03e0d2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tm2/pkg/crypto/secp256k1/secp256k1_nocgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ package secp256k1

import (
"github.com/btcsuite/btcd/btcec/v2"
secp256k1 "github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/ecdsa"
"github.com/decred/dcrd/dcrec/secp256k1/v4"

"github.com/gnolang/gno/tm2/pkg/crypto"
)

// Sign creates an ECDSA signature on curve Secp256k1, using SHA256 on the msg.
// The returned signature will be of the form R || S (in lower-S form).
func (privKey PrivKeySecp256k1) Sign(msg []byte) ([]byte, error) {
priv, _ := secp256k1.PrivKeyFromBytes(privKey[:])
priv, _ := btcec.PrivKeyFromBytes(privKey[:])

sig, err := ecdsa.SignCompact(priv, crypto.Sha256(msg), false) // ref uncompressed pubkey
if err != nil {
Expand Down Expand Up @@ -48,7 +48,7 @@ func (pubKey PubKeySecp256k1) VerifyBytes(msg []byte, sigStr []byte) bool {
// that len(sigStr) == 64.
func signatureFromBytes(sigStr []byte) (*ecdsa.Signature, bool) {
// parse the signature:
var r, s btcec.ModNScalar
var r, s secp256k1.ModNScalar
if r.SetByteSlice(sigStr[:32]) {
return nil, false // overflow
}
Expand Down

0 comments on commit 03e0d2b

Please sign in to comment.