/Threshold-BBS-Plus-PCG

Primary LanguageGoApache License 2.0Apache-2.0

Psuedorandom Correlation Generator for Threshold BBS+

File Structure

  • dpf: Holds interface definitions and their implementation for Distributed Point Functions (DPF).
  • dspf: Aggregates multiple DPFs into shared Multipoint Functions i.e. Distributed Sum of Point Functions (DSPF).
    • dspf.go
    • dspf_key.go
    • dspf_test.go
    • dspf_util.go
  • pcg
    • bench
      • derive_tuple_test.go: Holds benchmarks for the tuple derivation.
      • eval_combined_test.go: Holds benchmarks for the PCG Evaluation of n-out-of-n shares.
      • eval_separate_test.go: Holds benchmarks for the PCG Evaluation of tau-out-of-n shares.
    • poly: Implements efficient polynomial operations via maps.
      • fft.go: Implements Fast Fourier Transform (FFT) for high-degree polynomial multiplication.
      • poly.go
      • poly_test.go
    • pcg.go: Implements the PCG. Also provides and optimized PCG Eval for n-out-of-n case.
    • pcg_test.go: Holds the end-to-end tests for the PCG Evaluation.
    • single_pcg.go: Implements a PCG for a single two-party (V)OLE for benchmarking.
    • single_pcg_test.go:
    • seed.go
    • tuple.go
    • tuple_test.go
    • utils.go
    • utils_test.go

Usage

Tests

Run the entire test suite from the root directory with:

go test ./...

End-to-End tests have been configured with smaller security parameters for faster execution. To run these tests specifically:

  • For n-out-of-n optimized PCG Evaluation:
    go test -run=TestPCGCombinedEnd2End ./pcg
  • For tau-out-of-n PCG Evaluation:
    go test -run=TestPCGSeparateEnd2End ./pcg

Benchmarks

Benchmarks for individual components can be found within the _test.go files of their respective directories. To benchmark the PCG Evaluation use:

go test -bench=. ./pcg/bench

For more granular benchmarking, such as assessing the performance for a specific subset of parameters, you can specify which benchmarks to run. For example, to benchmark the 2-out-of-3 case for all N, execute:

go test -bench=BenchmarkOpEvalSeparate2outof3_N ./pcg/bench

or to benchmark the 10-out-of-10 case for a specific N=15, execute:

go test -bench=BenchmarkOpEvalCombined10outof10_N15 ./pcg/bench

consider to set the -timeout flag, as most benchmarks require more than 11 minutes which is the standard timeout for go test.