From 7f3cd72cdda32aa746683b7615d94018cd657a23 Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef Date: Tue, 28 Oct 2025 16:58:59 -0600 Subject: [PATCH 1/4] vendoring comment --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index feadb213..6656da8d 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). From fb07f1cc38115dfbc0b62c51f80d136653cc998b Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef Date: Tue, 28 Oct 2025 17:03:25 -0600 Subject: [PATCH 2/4] clearer build boundary --- bls.go | 3 +++ bls_multisig.go | 3 +++ dkg_feldmanvss.go | 3 +++ dkg_feldmanvssq.go | 3 +++ dkg_jointfeldman.go | 3 +++ 5 files changed, 15 insertions(+) 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 * From 81262e89df8a9e8b03741cc38bc7a7b44d729f97 Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef Date: Tue, 28 Oct 2025 17:07:26 -0600 Subject: [PATCH 3/4] minor readme updates --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6656da8d..56865e0f 100644 --- a/README.md +++ b/README.md @@ -68,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`. @@ -104,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 @@ -137,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 dealers. * same assumptions about the communication channels as in Feldman VSS. From d0e84e8b22a87d2ad30324a67e70fb3f434ecb16 Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef <50252200+tarakby@users.noreply.github.com> Date: Wed, 29 Oct 2025 08:22:23 +0800 Subject: [PATCH 4/4] Update README.md Co-authored-by: Jordan Schalm --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56865e0f..e938f036 100644 --- a/README.md +++ b/README.md @@ -137,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 parallel instances of Feldman VSS Qual, each with a different dealers. + * based on parallel instances of Feldman VSS Qual, each with a different dealer. * same assumptions about the communication channels as in Feldman VSS.