MSB 5PC Adder: 5-of-5 to 3-of-3 additive re-sharing of Vec<Shares> - #149
MSB 5PC Adder: 5-of-5 to 3-of-3 additive re-sharing of Vec<Shares>#149gayathrigarimella wants to merge 8 commits into
Conversation
Generalizes the node-setup layer beyond the 3-party ring: NetworkSession
gains Role-addressed send_to/receive_from, MpcNetworkHandle/PeerConnections
now establish connections to any number of peers instead of exactly 2, and
a new MeshControlChannel provides a Role-addressed control-plane channel
(with an all-to-all sync barrier) alongside the untouched 3-party
ControlChannel. Also fixes build_network_handle deriving only 3 local
identities regardless of party count.
Adds two new shared-PRF key configurations for a 5-party protocol:
ThresholdPrfKeys (a (3,5) config where k_{i,j} is known only to the 3
parties outside {i,j}) and PairwisePrfKeys (lambda_{i,j} known only to i
and j), each with a symmetric XOR-combine network handshake in
protocol::ops. All existing 3PC structs, signatures, and behavior are
unchanged.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The struct defines 2 senders s0, s1 and 3 receivers r0, r1 and r2. |
marsenis
left a comment
There was a problem hiding this comment.
This looks great! Only minor comments.Thanks, Gayathri!
Let me first merge Evangelia's PR into tfhard-5pc, resolve conflicts with the base branch and run linter, and then I'll approve for merging.
| T: NetworkInt, | ||
| Standard: Distribution<T>, | ||
| { | ||
| roles.validate()?; |
There was a problem hiding this comment.
Let's make this a debug_assert!(roles.validate().is_ok());. It might slow down production code if it runs every time this function is called.
| } | ||
| } | ||
|
|
||
| /// Convenience wrapper over [`reshare_five_to_three_additive`] hardcoding the |
|
|
||
| /// Reconstructs the plaintext values from the 3 recipients' 3-of-3 | ||
| /// additive shares | ||
| fn reconstruct_additive_shares_5of3(recipient_shares: &[(Role, Vec<RingElement<u16>>)]) -> Vec<u16> { |
There was a problem hiding this comment.
nit: rename perhaps? The 5 in the function name is confusing since we're reconstructing a 3-of-3 sharing.
| } | ||
| } | ||
|
|
||
| let reconstructed = reconstruct_additive_shares_5of3(&results); |
There was a problem hiding this comment.
Can we use the more general function reconstruct_additive_shares() defined in test_utils.rs?
inputs -> given 5 parties with a Vec
outputs -> 3 parties with Vec of same underlying value; support default configuration of parties that learn the output P_0, P_1, P_2 and flexible configuration to modify the three parties that learn the output.
main changes are in new file rss5_ops.rs with some testing support in test_utils.rs (create 5 party additive shares and reconstruct additive shares). the changes include