Skip to content

Commit

Permalink
fix: build properly when using libsecp256k1 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongwoo Lee authored May 13, 2021
1 parent 8353d2a commit 43e2b66
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ else
endif
endif

# secp256k1 implementation selection
ifeq (libsecp256k1,$(findstring libsecp256k1,$(LBM_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += libsecp256k1
endif

build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

Expand Down
2 changes: 1 addition & 1 deletion crypto/keys/secp256k1/secp256k1_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func (privKey *PrivKey) Sign(msg []byte) ([]byte, error) {

// VerifySignature validates the signature.
// The msg will be hashed prior to signature verification.
func (pubKey *PrivKey) VerifySignature(msg []byte, sig []byte) bool {
func (pubKey *PubKey) VerifySignature(msg []byte, sig []byte) bool {
return secp256k1.VerifySignature(pubKey.Key, crypto.Sha256(msg), sig)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/line/iavl/v2 v2.0.0-init.1.0.20210507092458-8331d3daef36
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d
github.com/line/ostracon v0.34.9-0.20210512045543-6c7ab0535e10
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524
github.com/line/wasmvm v0.14.0-0.5.0
github.com/magiconair/properties v1.8.4
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,9 @@ github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55 h1:cXVtMiJkvQ4kn0px
github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55/go.mod h1:DHRJroSL7NaRkpvocRx3OtRsleXVsYSxBI9SfHFlTQ0=
github.com/line/iavl/v2 v2.0.0-init.1.0.20210507092458-8331d3daef36 h1:811bq0lFSv91AsR9mikOs+ArELnxVeNuYWh8QYUkL6k=
github.com/line/iavl/v2 v2.0.0-init.1.0.20210507092458-8331d3daef36/go.mod h1:0Xz+0i1nlB9lrjUDEwpDRhcmjfEAkOjd20dRb40FBso=
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d h1:/6vnjrk3SpCUUiIDBv8UzbYexabZBYXxkwyc3Bp9hPo=
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw=
github.com/line/ostracon v0.34.9-0.20210512045543-6c7ab0535e10 h1:Ab+t7zJRhoHYZlQTtdwOSNUyl+FKGXBj0zKf3658baI=
github.com/line/ostracon v0.34.9-0.20210512045543-6c7ab0535e10/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw=
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524 h1:eKXXnUm1SblC0AIXAMNDaSyvIbQ50yXqFbh9+Q8Kjvg=
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524/go.mod h1:wmkyPabXjtVZ1dvRofmurjaceghywtCSYGqFuFS+TbI=
github.com/line/wasmvm v0.14.0-0.5.0 h1:FRjzcUh+LiTMvCrSoucL7a5DlWHHRQgZ78h8YB8l4Fs=
Expand Down

0 comments on commit 43e2b66

Please sign in to comment.