Skip to content

Commit 2451274

Browse files
authored
Merge pull request #37 from onflow/tarak/vendoring
Clarification about Go vendoring
2 parents e8ca7de + d0e84e8 commit 2451274

6 files changed

Lines changed: 25 additions & 5 deletions

File tree

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@ Building with this flag results in a slower performance, it is therefore recomme
4343
CGO_CFLAGS="-O2 -D__BLST_PORTABLE__" go build
4444
```
4545

46-
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`.
47-
You also need to set the `GOOS` and `GOARCH` variables.For example, to compile the test program for linux arm64:
46+
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:
4847

4948
```
5049
GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 go build
5150
```
51+
52+
#### Vendoring
53+
54+
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.
55+
56+
5257
### Build without cgo
5358

5459
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
6368

6469
## Algorithms
6570

66-
### Hashing and Message Authentication Code:
71+
### Hashing and MAC:
6772

6873
`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`.
6974

@@ -99,7 +104,7 @@ All signature schemes use the generic interfaces of `PrivateKey` and `PublicKey`
99104
* verification of an aggregated signature of multiple messages under multiple public keys.
100105
* batch verification of multiple signatures of a single message under multiple
101106
public keys, using a binary tree of aggregations.
102-
* SPoCK scheme based on BLS: verifies two signatures have been generated from the same message that is unknown to the verifier.
107+
* SPoCK scheme based on BLS: verifies two signatures have been generated from the same secret that is unknown to the verifier.
103108

104109
### PRNG
105110

@@ -132,5 +137,5 @@ All supported Distributed Key Generation protocols are [discrete log based](http
132137
* implements a complaint mechanism to qualify/disqualify the dealer.
133138
* Joint Feldman (Pedersen) (requires cgo)
134139
* distributed generation.
135-
* based on multiple parallel instances of Feldman VSS Qual with multiple dealers.
140+
* based on parallel instances of Feldman VSS Qual, each with a different dealer.
136141
* same assumptions about the communication channels as in Feldman VSS.

bls.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build cgo && !no_cgo
2+
// +build cgo,!no_cgo
3+
14
/*
25
* Flow Crypto
36
*

bls_multisig.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build cgo && !no_cgo
2+
// +build cgo,!no_cgo
3+
14
/*
25
* Flow Crypto
36
*

dkg_feldmanvss.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build cgo && !no_cgo
2+
// +build cgo,!no_cgo
3+
14
/*
25
* Flow Crypto
36
*

dkg_feldmanvssq.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build cgo && !no_cgo
2+
// +build cgo,!no_cgo
3+
14
/*
25
* Flow Crypto
36
*

dkg_jointfeldman.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build cgo && !no_cgo
2+
// +build cgo,!no_cgo
3+
14
/*
25
* Flow Crypto
36
*

0 commit comments

Comments
 (0)