Skip to content

Commit

Permalink
VDAF-06+ ping-pong topology (#683)
Browse files Browse the repository at this point in the history
Implements the ping-pong topology introduced in VDAF-06 and refined
in VDAF-07.

We add a `topology` module, on the premise that we might someday add new
topologies and their implementations there, and `topology::ping_pong`.

This also adds an implementation of a dummy VDAF, brought over from
Janus ([1]). `vdaf::dummy` is only compiled if the `test-util` Cargo
feature is enabled. The dummy VDAF implements the `vdaf::{Vdaf,
Aggregator, Client, Collector}` and provides associated types for output
shares, prepare shares, etc., but it doesn't do anything except return
success, making it useful for testing higher-level constructions like
ping-pong.

Finally, we replace the derived `std::fmt::Debug` implementations on a
few `prio3` and `poplar1` associated types so that they redact fields
that are either sensitive secrets or just too big to be worth printing
when debugging. This is so that we can provide `Debug` impls on new
types in `topology::ping_pong` without pulling in crate `derivative`,
which would require us to do 9,000+ lines of audits.

[1]: https://github.com/divviup/janus
  • Loading branch information
tgeoghegan authored Sep 13, 2023
1 parent 426ae91 commit a04238c
Show file tree
Hide file tree
Showing 8 changed files with 1,338 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ itertools = "0.11.0"
modinverse = "0.1.0"
num-bigint = "0.4.4"
once_cell = "1.18.0"
prio = { path = ".", features = ["crypto-dependencies"] }
prio = { path = ".", features = ["crypto-dependencies", "test-util"] }
rand = "0.8"
serde_json = "1.0"
statrs = "0.16.0"
Expand All @@ -58,6 +58,7 @@ experimental = ["bitvec", "fiat-crypto", "fixed", "num-bigint", "num-rational",
multithreaded = ["rayon"]
prio2 = ["crypto-dependencies", "hmac", "sha2"]
crypto-dependencies = ["aes", "ctr"]
test-util = ["rand"]

[workspace]
members = [".", "binaries"]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ mod fp;
pub mod idpf;
mod polynomial;
mod prng;
pub mod topology;
pub mod vdaf;
7 changes: 7 additions & 0 deletions src/topology/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: MPL-2.0

//! Implementations of some aggregator communication topologies specified in [VDAF].
//!
//! [VDAF]: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vdaf-06#section-5.7
pub mod ping_pong;
Loading

0 comments on commit a04238c

Please sign in to comment.