go-ethereum/crypto
Daniel Liu d2ac7d0987 crypto: fix build when CGO_ENABLED=0 (#19121)
Package crypto works with or without cgo, which is great. However, to make it
work without cgo required setting the build tag `nocgo`. It's common to disable
cgo by instead just setting the environment variable `CGO_ENABLED=0`. Setting
this environment variable does _not_ implicitly set the build tag `nocgo`. So
projects that try to build the crypto package with `CGO_ENABLED=0` will fail. I
have done this myself several times. Until today, I had just assumed that this
meant that this package requires cgo.

But a small build tag change will make this case work. Instead of using `nocgo`
and `!nocgo`, we can use `!cgo` and `cgo`, respectively. The `cgo` build tag is
automatically set if cgo is enabled, and unset if it is disabled.
2024-12-09 17:48:59 +08:00
..
blake2b new EVM Upgrade 2021-09-21 16:53:46 +05:30
bn256 crypto/bn256: fix staticcheck warning SA9009: ineffectual compiler directive 2024-10-30 21:10:45 +08:00
ecies crypto/ecies: remove unused function (#19096) 2024-12-09 17:48:59 +08:00
randentropy FIx Bad block error. 2021-09-17 17:59:06 +05:30
secp256k1 rpc:remove package ethereum/go-ethereum 2024-05-13 19:51:50 +08:00
crypto.go all: replace uses of ioutil with io and os (#24869) 2024-09-27 15:14:17 +08:00
crypto_test.go all: replace uses of ioutil with io and os (#24869) 2024-09-27 15:14:17 +08:00
signature_cgo.go crypto: fix build when CGO_ENABLED=0 (#19121) 2024-12-09 17:48:59 +08:00
signature_nocgo.go crypto: fix build when CGO_ENABLED=0 (#19121) 2024-12-09 17:48:59 +08:00
signature_test.go new EVM Upgrade 2021-09-21 16:53:46 +05:30