Prerequisites
This assumes GarbleMode already supports VSSS input generation (#66 completed).
Overview
Integrate VSSS-enabled GarbleMode into the C&C protocol. The key challenge: polynomial sharing across all circuit instances and enabling polynomial reconstruction by the evaluator.
Problem
GarbleMode now expects pre-computed VSSS shares
- C&C needs to coordinate polynomial generation across all instances
- Evaluator must collect polynomial points to reconstruct secrets later
Architecture Changes
1. Garbler Changes
Before garbling any circuits:
// Input: seed, n_input_wires, n_circuits
// Generate polynomials ONCE for all circuits
let vsss = VSSSInputPolynomials::generate(seed, n_input_wires, n_circuits);
// Create circuits with different shares
for circuit_id in 0..n_circuits {
let shares = vsss.get_circuit_shares(circuit_id);
let mode = GarbleMode::new_from_labels(
capacity, vsss.delta, shares, handler
);
// garble...
}
In commit phase:
- Add polynomial commitments to the commitment structure
- Share these commitments across ALL circuit instances
In open_commit phase:
- Reveal polynomial shares for checked circuits
- Include whatever seeds are needed for regarbling
2. Evaluator Changes
New responsibility: Track polynomial points
struct EvaluatorState {
polynomial_points: Vec<Map<usize, (Fr, Fr)>>, // wire → circuit → shares
}
During verification:
- Verify revealed shares match polynomial commitments
- Store these points for later reconstruction
- When regarbling, extract input labels and convert to shares - store these too
After protocol (with adaptor signature):
// Now have 175 points (174 checked + 1 from signature)
let polynomials = reconstruct_polynomials(polynomial_points);
// Can now generate ANY circuit's input labels
Opening Structure
For checked circuits, garbler reveals:
- Circuit-specific data needed for regarbling
- Polynomial shares:
Vec<(Fr, Fr)> for each input wire
Implementation Steps
Phase 1: Modify Garbler
Phase 2: Modify Evaluator
Phase 3: Protocol Updates
Data Flow
Garbler Evaluator
------- ---------
Generate polynomials
Create n circuits
→
commitments
←
select k to check
→
shares for k circuits
Verify & store points
Regarble → extract more points
...
←
adaptor signature
→
final share
Reconstruct polynomials!
Key Invariants
- Same polynomials used across ALL circuits
- Each circuit gets different evaluation point
- Evaluator needs exactly k+1 points to reconstruct
Success Criteria
- Evaluator can verify all VSSS commitments
- Evaluator successfully reconstructs polynomials with k+1 points
- Free-XOR maintained throughout
Prerequisites
This assumes
GarbleModealready supports VSSS input generation (#66 completed).Overview
Integrate VSSS-enabled
GarbleModeinto the C&C protocol. The key challenge: polynomial sharing across all circuit instances and enabling polynomial reconstruction by the evaluator.Problem
GarbleModenow expects pre-computed VSSS sharesArchitecture Changes
1. Garbler Changes
Before garbling any circuits:
In commit phase:
In open_commit phase:
2. Evaluator Changes
New responsibility: Track polynomial points
During verification:
After protocol (with adaptor signature):
Opening Structure
For checked circuits, garbler reveals:
Vec<(Fr, Fr)>for each input wireImplementation Steps
Phase 1: Modify Garbler
VSSSInputPolynomialsgeneration before circuit creationGarbleModeinstancecommit()outputopen_commit()to reveal shares for checked circuitsPhase 2: Modify Evaluator
Phase 3: Protocol Updates
Data Flow
Key Invariants
Success Criteria