Skip to content

Commit 43e2b66

Browse files
author
Yongwoo Lee
authored
fix: build properly when using libsecp256k1 (#195)
1 parent 8353d2a commit 43e2b66

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ else
6666
endif
6767
endif
6868

69+
# secp256k1 implementation selection
70+
ifeq (libsecp256k1,$(findstring libsecp256k1,$(LBM_BUILD_OPTIONS)))
71+
CGO_ENABLED=1
72+
BUILD_TAGS += libsecp256k1
73+
endif
74+
6975
build_tags += $(BUILD_TAGS)
7076
build_tags := $(strip $(build_tags))
7177

crypto/keys/secp256k1/secp256k1_cgo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ func (privKey *PrivKey) Sign(msg []byte) ([]byte, error) {
2121

2222
// VerifySignature validates the signature.
2323
// The msg will be hashed prior to signature verification.
24-
func (pubKey *PrivKey) VerifySignature(msg []byte, sig []byte) bool {
24+
func (pubKey *PubKey) VerifySignature(msg []byte, sig []byte) bool {
2525
return secp256k1.VerifySignature(pubKey.Key, crypto.Sha256(msg), sig)
2626
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/hashicorp/golang-lru v0.5.4 // indirect
3030
github.com/kr/text v0.2.0 // indirect
3131
github.com/line/iavl/v2 v2.0.0-init.1.0.20210507092458-8331d3daef36
32-
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d
32+
github.com/line/ostracon v0.34.9-0.20210512045543-6c7ab0535e10
3333
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524
3434
github.com/line/wasmvm v0.14.0-0.5.0
3535
github.com/magiconair/properties v1.8.4

go.sum

+2-1
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,9 @@ github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55 h1:cXVtMiJkvQ4kn0px
336336
github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55/go.mod h1:DHRJroSL7NaRkpvocRx3OtRsleXVsYSxBI9SfHFlTQ0=
337337
github.com/line/iavl/v2 v2.0.0-init.1.0.20210507092458-8331d3daef36 h1:811bq0lFSv91AsR9mikOs+ArELnxVeNuYWh8QYUkL6k=
338338
github.com/line/iavl/v2 v2.0.0-init.1.0.20210507092458-8331d3daef36/go.mod h1:0Xz+0i1nlB9lrjUDEwpDRhcmjfEAkOjd20dRb40FBso=
339-
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d h1:/6vnjrk3SpCUUiIDBv8UzbYexabZBYXxkwyc3Bp9hPo=
340339
github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw=
340+
github.com/line/ostracon v0.34.9-0.20210512045543-6c7ab0535e10 h1:Ab+t7zJRhoHYZlQTtdwOSNUyl+FKGXBj0zKf3658baI=
341+
github.com/line/ostracon v0.34.9-0.20210512045543-6c7ab0535e10/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw=
341342
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524 h1:eKXXnUm1SblC0AIXAMNDaSyvIbQ50yXqFbh9+Q8Kjvg=
342343
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524/go.mod h1:wmkyPabXjtVZ1dvRofmurjaceghywtCSYGqFuFS+TbI=
343344
github.com/line/wasmvm v0.14.0-0.5.0 h1:FRjzcUh+LiTMvCrSoucL7a5DlWHHRQgZ78h8YB8l4Fs=

0 commit comments

Comments
 (0)