diff --git a/README.md b/README.md index feadb213..e938f036 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,17 @@ Building with this flag results in a slower performance, it is therefore recomme CGO_CFLAGS="-O2 -D__BLST_PORTABLE__" go build ``` -If you're cross-compiling, you need to set the `CC` environment variable to the target C cross-compiler and set `CGO_ENABLED` to `1`. -You also need to set the `GOOS` and `GOARCH` variables.For example, to compile the test program for linux arm64: +If you're cross-compiling, you need to set the `CC` environment variable to the target C cross-compiler and set `CGO_ENABLED` to `1`. For example, to compile the test program for linux arm64: ``` GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 go build ``` + +#### Vendoring + +When using the `go mod vendor` command in your project, [a known issue](https://github.com/golang/go/issues/26366) with the Go vendoring tool prevents cgo dependencies from being copied into your vendor directory. This results in build errors related to the Flow crypto package. External vendoring tools that do copy the entire package files can be used instead of the Go command to resolve the issue. + + ### Build without cgo It is possible to build without cgo but this requires disabling all primitives based on the BLS12-381 curve (BLS signature, BLS threshold signature, BLS-based DKG, BLS-based SPoCK). @@ -63,7 +68,7 @@ CGO_ENABLED=0 go build -tags=no_cgo ## Algorithms -### Hashing and Message Authentication Code: +### Hashing and MAC: `crypto/hash` provides the hashing and MAC algorithms required for Flow. All algorithm implement the generic interface `Hasher`. All digests are of the generic type `Hash`. @@ -99,7 +104,7 @@ All signature schemes use the generic interfaces of `PrivateKey` and `PublicKey` * verification of an aggregated signature of multiple messages under multiple public keys. * batch verification of multiple signatures of a single message under multiple public keys, using a binary tree of aggregations. - * SPoCK scheme based on BLS: verifies two signatures have been generated from the same message that is unknown to the verifier. + * SPoCK scheme based on BLS: verifies two signatures have been generated from the same secret that is unknown to the verifier. ### PRNG @@ -132,5 +137,5 @@ All supported Distributed Key Generation protocols are [discrete log based](http * implements a complaint mechanism to qualify/disqualify the dealer. * Joint Feldman (Pedersen) (requires cgo) * distributed generation. - * based on multiple parallel instances of Feldman VSS Qual with multiple dealers. + * based on parallel instances of Feldman VSS Qual, each with a different dealer. * same assumptions about the communication channels as in Feldman VSS. diff --git a/bls.go b/bls.go index e80465cf..4cb7feba 100644 --- a/bls.go +++ b/bls.go @@ -1,3 +1,6 @@ +//go:build cgo && !no_cgo +// +build cgo,!no_cgo + /* * Flow Crypto * diff --git a/bls_multisig.go b/bls_multisig.go index 03f55e6e..0caa0997 100644 --- a/bls_multisig.go +++ b/bls_multisig.go @@ -1,3 +1,6 @@ +//go:build cgo && !no_cgo +// +build cgo,!no_cgo + /* * Flow Crypto * diff --git a/dkg_feldmanvss.go b/dkg_feldmanvss.go index 959da868..bff46742 100644 --- a/dkg_feldmanvss.go +++ b/dkg_feldmanvss.go @@ -1,3 +1,6 @@ +//go:build cgo && !no_cgo +// +build cgo,!no_cgo + /* * Flow Crypto * diff --git a/dkg_feldmanvssq.go b/dkg_feldmanvssq.go index bc1bf72a..19cb29f9 100644 --- a/dkg_feldmanvssq.go +++ b/dkg_feldmanvssq.go @@ -1,3 +1,6 @@ +//go:build cgo && !no_cgo +// +build cgo,!no_cgo + /* * Flow Crypto * diff --git a/dkg_jointfeldman.go b/dkg_jointfeldman.go index 14e05c6c..51e80323 100644 --- a/dkg_jointfeldman.go +++ b/dkg_jointfeldman.go @@ -1,3 +1,6 @@ +//go:build cgo && !no_cgo +// +build cgo,!no_cgo + /* * Flow Crypto *