Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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`.

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
3 changes: 3 additions & 0 deletions bls.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo && !no_cgo
// +build cgo,!no_cgo

/*
* Flow Crypto
*
Expand Down
3 changes: 3 additions & 0 deletions bls_multisig.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo && !no_cgo
// +build cgo,!no_cgo

/*
* Flow Crypto
*
Expand Down
3 changes: 3 additions & 0 deletions dkg_feldmanvss.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo && !no_cgo
// +build cgo,!no_cgo

/*
* Flow Crypto
*
Expand Down
3 changes: 3 additions & 0 deletions dkg_feldmanvssq.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo && !no_cgo
// +build cgo,!no_cgo

/*
* Flow Crypto
*
Expand Down
3 changes: 3 additions & 0 deletions dkg_jointfeldman.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo && !no_cgo
// +build cgo,!no_cgo

/*
* Flow Crypto
*
Expand Down