Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com> Co-authored-by: Alex | Interchain Labs <alex@skip.money> |
||
|---|---|---|
| .. | ||
| libsecp256k1 | ||
| .gitignore | ||
| curve.go | ||
| dummy.go | ||
| ext.h | ||
| LICENSE | ||
| panic_cb.go | ||
| README.md | ||
| scalar_mult_cgo.go | ||
| scalar_mult_nocgo.go | ||
| secp256_test.go | ||
| secp256.go | ||
secp256k1
This package is copied from 8fddf27a98/crypto/secp256k1
Unlike the rest of go-ethereum it is 3-clause BSD licensed so compatible with our Apache2.0 license. We opt to copy in here rather than depend on go-ethereum to avoid issues with vendoring of the GPL parts of that repository by downstream.
Duplicate Symbols
If a project is importing go-ethereum and the Cosmos SDK, cgo secp256k1 will only work on linux operating systems due to duplicated symbols. If you are testing on a mac, we recommend using a docker container or something similar.
To avoid duplicate symbol errors ldflags must be set to allow for multiple definitions.
Gcc
go build -tags libsecp256k1_sdk -ldflags=all="-extldflags=-Wl,--allow-multiple-definition"
Clang
go build -tags libsecp256k1_sdk -ldflags=all="-extldflags=-zmuldefs"