Modern Cryptography · Module 12

Secure Multi-Party
Computation

From Yao's Millionaires to Privacy-Preserving ML —
Protocols, Secret Sharing & Real-World Deployment

Secret Sharing Garbled Circuits Oblivious Transfer Malicious Security

The Millionaires' Problem

Andrew Yao, 1982: Two millionaires want to know who is richer without revealing their actual wealth to each other. This deceptively simple problem launched the field of secure computation.

Alice wealth = x Wants: x > y ? Bob wealth = y Wants: x > y ? Encrypted comparison protocol Encrypted response Output: x > y (1-bit) Neither party learns the other's actual wealth
Key insight: Yao showed this is solvable using garbled circuits and oblivious transfer. The result generalizes: any function computable by a Boolean circuit can be securely evaluated by two parties. This became the foundation of all MPC.

MPC: Formal Definition

n parties P1, ..., Pn each hold private input xi. They wish to jointly compute y = f(x1, ..., xn) such that each party learns only y (and nothing else about others' inputs).

Ideal vs. Real World Paradigm

Security is defined by comparison to an ideal world where a trusted third party (TTP) collects all inputs, computes f, and distributes outputs. A protocol is secure if no adversary can distinguish the real execution from the ideal one.

  IDEAL WORLD:                    REAL WORLD:
  P1 --x1--> [TTP] --y--> P1     P1 <----protocol----> P2
  P2 --x2--> [TTP] --y--> P2         (no trusted party)
  ...                             ...
  Pn --xn--> [TTP] --y--> Pn     Pn <----protocol----> P1

Privacy

No party learns anything beyond its prescribed output. Formally: the view of each party can be simulated from its input and output alone.

Correctness

The output is guaranteed to be the correct evaluation of f, even if some parties deviate from the protocol.

Independence

Corrupt parties must choose their inputs independently of honest parties' inputs (no adaptive input selection).

Security Models

The strength of an MPC protocol depends on what adversary it resists. Two orthogonal axes: adversary behavior and corruption threshold.

Semi-Honest (Passive)

Corrupted parties follow the protocol faithfully but try to extract extra information from their transcript (messages received + internal state).

Assumption: Parties are "honest but curious"
Advantage: Simpler, faster protocols
Use: Trusted corporate environments

Efficient Weaker guarantee

Malicious (Active)

Corrupted parties can arbitrarily deviate from the protocol: send wrong messages, abort early, use inconsistent inputs.

Assumption: Worst-case adversary
Cost: 10-1000x overhead vs. semi-honest
Use: Adversarial / regulatory settings

Robust Expensive

Honest Majority (t < n/2)

Assumes more than half the parties are honest. Enables information-theoretic security (no computational assumptions) and efficient protocols over arithmetic circuits.

IT-secure Efficient

Dishonest Majority (t < n)

Up to n-1 parties may be corrupt. Requires computational assumptions (OT, public-key crypto). Security with abort is achievable; guaranteed output delivery is not.

Strongest threat Comp. assumptions

SECTION I

Secret Sharing Foundations

Splitting secrets so no single party learns anything

Shamir's Secret Sharing

Adi Shamir (1979): A (t, n)-threshold scheme where any t+1 shares reconstruct the secret, but t or fewer shares reveal nothing. Based on polynomial interpolation over a finite field.

Construction

  Share(s, t, n):
    1. Choose random a₁, a₂, ..., aₜ ∈ F_p
    2. Define polynomial: f(x) = s + a₁x + a₂x² + ... + aₜxᵗ
    3. Give party Pᵢ the share: (i, f(i))

  Reconstruct(shares):
    Given t+1 points (xᵢ, yᵢ), use Lagrange interpolation:
    s = f(0) = Σᵢ yᵢ · Πⱼ≠ᵢ (xⱼ / (xⱼ - xᵢ))  mod p
f(x) = s + a₁x + a₂x² (degree t=2, threshold t+1=3) f(0)=s P₁: f(1) P₂: f(2) P₃: f(3) P₄: f(4) P₅: f(5) Any 3 points uniquely determine f(x) 2 or fewer points → infinite possible secrets
Information-theoretic security: With t or fewer shares, every possible secret is equally likely. No computational power helps the adversary — Shamir's scheme is perfectly secure against unbounded adversaries.

Additive Secret Sharing

The simplest form of secret sharing: split a value into n random shares that sum (or XOR) to the secret. Every party must participate in reconstruction — a (n, n)-threshold scheme.

XOR-Based (Boolean)

  Share(s):
    r₁, ..., rₙ₋₁ ← random bits
    rₙ = s ⊕ r₁ ⊕ ... ⊕ rₙ₋₁

  Reconstruct:
    s = r₁ ⊕ r₂ ⊕ ... ⊕ rₙ

Natural for Boolean circuits. XOR is free in garbled circuits. Each share is uniformly random.

Boolean circuits

Arithmetic (mod p)

  Share(s):
    r₁, ..., rₙ₋₁ ← random in F_p
    rₙ = s - r₁ - ... - rₙ₋₁ mod p

  Reconstruct:
    s = r₁ + r₂ + ... + rₙ mod p

Natural for arithmetic circuits. Addition of shared values is local — no communication needed.

Arithmetic circuits

The addition-is-free principle: If [x] = (x₁, ..., xₙ) and [y] = (y₁, ..., yₙ) are additive shares, then [x+y] = (x₁+y₁, ..., xₙ+yₙ). Each party adds locally — zero communication. Multiplication is the hard part and requires interaction.

Beaver Triples

Donald Beaver (1991): Precompute random multiplication triples (a, b, c) where c = a·b in an offline phase. Use them to multiply shared values in the online phase with only 2 rounds of communication.

Beaver's Multiplication Protocol

  Given: shares [x], [y], and precomputed triple ([a], [b], [c]) where c = a·b

  1. Each party computes and opens:
     [d] = [x] - [a]  →  reveal d = x - a
     [e] = [y] - [b]  →  reveal e = y - b

  2. Each party locally computes:
     [x·y] = d·e + d·[b] + e·[a] + [c]

  Correctness: d·e + d·b + e·a + c
             = (x-a)(y-b) + (x-a)b + (y-b)a + ab
             = xy - ay - xb + ab + xb - ab + ay - ab + ab = xy  ✓
2
Rounds per multiply

Open d and e simultaneously
then compute locally

O(n)
Communication per multiply

Each party broadcasts
two field elements

Offline
Triple generation

Expensive part done
before inputs are known

SECTION II

Two-Party Protocols

Garbled circuits · Oblivious transfer · Gate-by-gate evaluation

GMW Protocol

Goldreich, Micali, Wigderson (1987): Evaluate a Boolean circuit gate-by-gate using XOR secret shares. XOR gates are free; AND gates require oblivious transfer.

Gate-by-Gate Evaluation

Each wire w carries a secret-shared bit: w = wA ⊕ wB (Alice holds wA, Bob holds wB).

  XOR gate (z = x ⊕ y):
    Alice: z_A = x_A ⊕ y_A     (local computation — FREE)
    Bob:   z_B = x_B ⊕ y_B

  AND gate (z = x ∧ y):
    z = (x_A ⊕ x_B) ∧ (y_A ⊕ y_B)
      = x_A·y_A ⊕ x_A·y_B ⊕ x_B·y_A ⊕ x_B·y_B
    Alice knows x_A·y_A, Bob knows x_B·y_B
    Cross-terms x_A·y_B and x_B·y_A require 1-out-of-4 OT
Rounds vs. computation: GMW requires O(depth) rounds of interaction — one round per AND-gate layer. For shallow circuits this is efficient; for deep circuits (e.g., AES), Yao's garbled circuits (constant rounds) may be preferable.
Multi-party extension: GMW generalizes naturally to n parties. Each AND gate requires n-choose-2 pairwise OTs. The protocol scales to arbitrary numbers of parties, unlike Yao's original 2-party scheme.

Oblivious Transfer (OT)

The fundamental primitive of two-party computation. In 1-out-of-2 OT, a sender holds two messages (m0, m1). The receiver with choice bit b learns mb and nothing about m1-b. The sender learns nothing about b.

Sender m₀, m₁ Learns nothing about b Receiver choice bit b Learns m_b only Public-key based exchange Encrypted selection Receiver obtains m_b, learns nothing about m_{1-b} Sender learns nothing about b

Base OT

Uses public-key crypto (RSA, ECC, or lattice-based). Costly: ~milliseconds per OT. Naor-Pinkas protocol is standard.

Expensive ~128 base OTs

OT Extension

IKNP (2003): Use ~128 base OTs to generate millions of OTs using only symmetric crypto (hash + XOR). Amortized cost: microseconds per OT.

Efficient Key technique

Garbled Circuits

Yao's garbled circuit protocol (1986): The garbler encrypts a Boolean circuit gate-by-gate. The evaluator decrypts exactly one output per gate without learning intermediate wire values.

Garbler (Alice) 1. Assign random labels k⁰_w, k¹_w per wire 2. Encrypt truth tables 3. Send garbled circuit Evaluator (Bob) 1. Receive garbled circuit 2. Get input labels via OT 3. Decrypt gate-by-gate 4. Output final labels Garbled circuit + Alice's input labels OT for Bob's input labels Garbled AND Gate (wire a, wire b → wire c): Enc(k⁰_a, k⁰_b, k⁰_c) → garbled row 0 Enc(k⁰_a, k¹_b, k⁰_c) → garbled row 1 Enc(k¹_a, k⁰_b, k⁰_c) → garbled row 2 Enc(k¹_a, k¹_b, k¹_c) → garbled row 3 (0 AND 0 = 0) (0 AND 1 = 0) (1 AND 0 = 0) (1 AND 1 = 1)
Constant rounds: Yao's protocol requires only O(1) rounds of interaction (send circuit + OT), regardless of circuit depth. Communication is O(|C|·k) where |C| is the number of gates and k is the security parameter.

Garbled Circuit Optimizations

Decades of research have reduced the cost of garbled circuits from 4 ciphertexts per gate to as low as 1.5.

OptimizationCiphertexts/GateKey IdeaYear
Naive4Encrypt all 4 truth table rows1986
Point-and-Permute4Append permute bit to labels; evaluator decrypts only 1 row1990
Row Reduction (GRR3)3Set one output label so one ciphertext is all-zeros1999
Free XOR0 (XOR)Global offset R: k1w = k0w ⊕ R for all wires2008
Half-Gates2 (AND)Split AND into garbler-half + evaluator-half2015
Three Halves1.5 (AND)Slicing technique, amortized across gates2021

Half-Gates Technique (Zahur, Rosulek, Evans 2015)

Key insight: decompose AND(a, b) into two "half-gates" — one where the garbler knows one input, one where the evaluator knows one input. Each half-gate costs 1 ciphertext, totaling 2 ciphertexts per AND gate. Combined with Free XOR, this is optimal for a class of linear garbling schemes.

Practical impact: For AES-128 (6,800 AND gates), half-gates reduces garbled circuit size from 6,800 × 4 × 16B = 435 KB (naive) to 6,800 × 2 × 16B = 218 KB. With Free XOR, the ~25,000 XOR gates are truly free.

BMR Protocol

Beaver, Micali, Rogaway (1990): Extends garbled circuits to n parties while maintaining constant rounds. All parties jointly generate one garbled circuit, then evaluate it non-interactively.

Phase 1: Joint Garbling Each party contributes partial labels k^b_{w,i} Interactive (O(depth) rounds) Phase 2: Input Sharing Each Pᵢ reveals labels for their input wires 1 round broadcast Phase 3: Evaluation Every party evaluates the garbled circuit locally No interaction needed Key: Wire label = k^b_w = k^b_{w,1} ⊕ k^b_{w,2} ⊕ ... ⊕ k^b_{w,n} Each party contributes one share; garbled table uses the combined label
Trade-off: BMR achieves constant online rounds for n parties but requires O(n) ciphertexts per gate (each party contributes a label share). Communication per gate scales as O(n·k) vs. O(k) in two-party Yao. Best for small n with deep circuits.
SECTION III

Malicious Security

SPDZ · Shamir-based MPC · MAC verification

SPDZ Protocol

Damgard, Pastro, Smart, Zakarias (2012): Achieves malicious security with dishonest majority using information-theoretic MACs on all shared values. Name pronounced "Speedz."

SPDZ Architecture: Offline + Online

  Each shared value x has MAC:  [x] = (x₁,...,xₙ)  with  [α·x] = MAC shares
  Global MAC key α is itself secret-shared: α = α₁ + ... + αₙ

  OFFLINE PHASE (expensive):
    Generate Beaver triples with MACs using Somewhat HE or OT
    All triples: ([a], [b], [c]) with [α·a], [α·b], [α·c]

  ONLINE PHASE (fast):
    Addition: [x+y] = [x] + [y], MACs add locally
    Multiplication: Beaver's protocol using precomputed triples
    Output: Open value, then MAC-check to detect cheating

  MAC CHECK: Verify α·x = Σᵢ m_i where m_i are MAC shares
    → Any deviation by malicious party detected with prob 1 - 2⁻ˢ
IT
Online Security

Information-theoretic MAC
cannot be forged

n-1
Corruption threshold

Tolerates up to n-1
malicious parties

~2x
vs. Semi-Honest

Online phase is only
~2x slower than passive

Shamir-Based MPC (Honest Majority)

When t < n/2 parties are corrupt, Shamir secret sharing enables highly efficient MPC over arithmetic circuits with information-theoretic security. The BGW protocol (1988) is the foundation.

BGW Protocol

  Share inputs: Each Pᵢ shares xᵢ with degree-t Shamir sharing

  Addition gate:  [x+y]ᵢ = [x]ᵢ + [y]ᵢ           (local, free)
  Constant mult:  [c·x]ᵢ = c · [x]ᵢ               (local, free)

  Multiplication gate (the hard part):
    1. Local multiply: hᵢ = [x]ᵢ · [y]ᵢ            (degree 2t polynomial!)
    2. Degree reduction: Reshare hᵢ with degree t
       → Each party sends shares to all others        (O(n²) communication)
       → Recombine using Lagrange on degree-2t points
    3. Result: degree-t sharing of x·y
The degree-reduction problem: Multiplying two degree-t Shamir shares yields a degree-2t polynomial. With n ≥ 2t+1 parties, we have enough points to interpolate and re-share at degree t. This is why honest majority (t < n/2) is required.
Communication complexity: Each multiplication gate costs O(n2) field elements. Optimizations like DN07 (Damgard-Nielsen) and Goyal-Song reduce this to O(n) per gate amortized, making Shamir-based MPC competitive for many parties.
SECTION IV

Applications

Private set intersection · ML · Auctions · Key management

Private Set Intersection (PSI)

Two parties hold sets X and Y. They want to learn X ∩ Y without revealing elements not in the intersection. A flagship MPC application with major real-world deployments.

Alice's Set X {a, b, c, d, e} Bob's Set Y {c, d, f, g, h} X ∩ Y {c, d} PSI Approaches OT-based KKRT (2016): O(n) OTs DH-based OPRF via Diffie-Hellman Circuit-based Sort-Compare-Shuffle FHE-based Chen-Laine-Rindal (2017)

Scale

Modern OT-based PSI handles 228 elements (268M) in under 100 seconds. Communication: ~1 byte per element with cuckoo hashing.

Variants

PSI-Cardinality: learn only |X ∩ Y|
PSI-Sum: learn sum of associated values
Labeled PSI: retrieve payloads for matched items

Deployments

Google: Private ad measurement
Apple: CSAM detection (NeuralHash + PSI)
Meta: Private ad attribution

Privacy-Preserving Machine Learning

MPC enables training and inference on joint datasets without revealing raw data. Critical for healthcare, finance, and cross-organizational collaboration.

Secret Share
Data → shares
Linear Layers
Matmul (Beaver)
Activation
ReLU via GC
Aggregation
Secret shares
Output
Reveal result

Inference (2PC/3PC)

Server holds model weights, client holds data. Evaluate neural network using mixed protocols:

Linear layers: Arithmetic SS (Beaver triples)
ReLU/comparisons: Garbled circuits or OT
Softmax: Approximation via polynomials

CrypTFlow2: ResNet-50 inference in 4.1 seconds (LAN)

Training

Multiple parties hold different training data partitions. Run SGD with secret-shared gradients:

Forward pass: Arithmetic + Boolean SS
Backprop: Fixed-point arithmetic in SS
Gradient update: Local after aggregation

SecureML: Training logistic regression on MNIST in ~40 minutes (2PC, WAN)

Mixed-protocol optimization: ABY (Arithmetic-Boolean-Yao) framework seamlessly converts between sharing types to use the cheapest protocol for each operation. Linear ops in arithmetic, comparisons in Boolean/Yao.

More MPC Applications

Secure Auctions

Sealed-bid auctions where bids remain private. Compute the winning bid and winner without revealing losing bids.

Danish sugar beet auction (2008): First large-scale MPC deployment. 1,229 farmers submitted bids through a 3-server MPC system. Computed market-clearing price in ~30 minutes.

Deployed

E-Voting

Voters submit encrypted ballots. MPC tallies votes without revealing individual choices. Enables universal verifiability.

Helios & Estonia: Threshold decryption of homomorphic ballots. ADDER: Secret-shared tallying protocol. Protects ballot secrecy even if some servers are compromised.

Critical

Key Management

Threshold signatures: t-of-n parties must collaborate to sign. No single point of compromise for private keys.

Fireblocks: MPC-based custody for $6T+ in digital assets. Threshold ECDSA: GG18/GG20 protocols for Bitcoin/Ethereum. Eliminates single key storage risk.

Production

Pattern: MPC excels when multiple parties must collaborate on a sensitive computation, no party should have unilateral access to all data, and a trusted third party is impractical or undesirable.

MPC + FHE: Combining Approaches

Fully Homomorphic Encryption and MPC are complementary. FHE enables non-interactive computation on encrypted data; MPC distributes trust. Combining them yields powerful hybrid protocols.

FHE for Offline Phase

SPDZ originally used Somewhat HE (Brakerski-Fan-Vercauteren) to generate Beaver triples. Each party encrypts random values under FHE, then jointly compute c = a·b homomorphically.

Advantage: fewer rounds than OT-based triple generation. Modern SPDZ variants (Overdrive, MASCOT) offer OT-based alternatives.

MPC for FHE Bootstrapping

Threshold FHE: distribute the FHE secret key among n parties. Decryption requires MPC (threshold decryption). Bootstrapping can be distributed to avoid any single party seeing plaintext.

Application: cloud computation where the cloud runs FHE, and multiple clients collaboratively decrypt results.

ApproachInteractionTrust ModelBest For
Pure MPCHigh (rounds per gate)DistributedLow-latency LAN settings
Pure FHENone (non-interactive)Key holderOutsourced computation
MPC + FHEMinimalDistributedWAN / high-latency settings
MPC + FHE + ZKModerateDistributed + verifiableRegulatory compliance

Communication Complexity & Rounds

Communication is the dominant bottleneck in MPC. Understanding the cost structure is essential for choosing the right protocol.

ProtocolSettingRoundsComm. per AND gateCorruption
Yao's GC2PCO(1)2κ bits (half-gates)Semi-honest
GMW2PC/nPCO(depth)O(n2κ) bitsSemi-honest
BMRnPCO(1)O(nκ) bits per gateSemi-honest
BGWnPCO(depth)O(n2) field elementst < n/2
SPDZnPCO(depth)O(n) field elementsMalicious
Cut-and-Choose GC2PCO(1)s·2κ bits (s copies)Malicious
Authenticated GC2PCO(1)~4κ bitsMalicious
LAN
10 Gbps, 0.1ms RTT

High bandwidth compensates
for large messages. Deep circuits OK.

WAN
100 Mbps, 50ms RTT

Latency dominates. Constant-round
protocols (Yao, BMR) preferred.

Mobile
10 Mbps, 100ms RTT

Bandwidth-constrained. Silent OT
and compact protocols critical.

Implementation Frameworks

Several mature open-source frameworks make MPC accessible to practitioners. Each targets different protocol families and security models.

FrameworkProtocolsSecurityLanguageKey Feature
MP-SPDZSPDZ, MASCOT, Shamir, BMR, YaoBothPython-like DSL / C++30+ protocol variants; most comprehensive
EMP-toolkitGarbled circuits, OT, authenticated GCBothC++Fastest 2PC garbled circuits
ABY / ABY3Arithmetic, Boolean, Yao (mixed)Semi-honestC++Mixed-protocol optimization
MOTIONGMW, BMR, arithmetic SSSemi-honestC++Multi-party, extensible
CrypTenArithmetic SS, Beaver triplesSemi-honestPython (PyTorch)ML-focused, PyTorch integration
SCALE-MAMBASPDZMaliciousPython-like / RustFull malicious security, MAMBA lang

MP-SPDZ Example: Millionaires' Problem

  # MP-SPDZ program — each party inputs their wealth privately
  wealth_alice = sint.get_input_from(0)    # Party 0's private input
  wealth_bob = sint.get_input_from(1)      # Party 1's private input

  result = (wealth_alice > wealth_bob)      # Secure comparison
  print_ln("Alice is richer: %s", result.reveal())  # Open result only

Real-World Deployments

MPC has moved from theory to production. Major technology companies deploy MPC at scale for privacy-critical applications.

Google: Private Ad Measurement

Google's Privacy Sandbox uses MPC (attribution reporting API) for measuring ad effectiveness without tracking individual users. Two non-colluding servers compute aggregate reports via secret sharing.

Production Billions of events

Apple: Private Relay & CSAM

iCloud Private Relay: Two-server architecture where neither server sees both user identity and destination. Threshold PSI used for CSAM detection (later paused).

Production Millions of users

Signal: Private Contact Discovery

Signal uses SGX-based PIR/PSI to discover which contacts are on Signal without revealing the user's full contact list to Signal's servers. SGX + cryptographic protocol for defense-in-depth.

Production 100M+ users

Financial: Inter-Bank Analytics

Boston Fed + MIT: MPC for cross-bank regulatory reporting. Unbound/Sepior (Coinbase): Threshold ECDSA for custody. ING: MPC-based money laundering detection across banks.

Production Regulatory

Performance Benchmarks

Practical performance of MPC protocols on representative computations. All numbers assume 128-bit security.

ComputationProtocolPartiesLAN TimeWAN TimeComm.
AES-128Yao (half-gates)20.5 ms55 ms218 KB
AES-128SPDZ (malicious)33 ms180 ms~1 MB
SHA-256Yao (half-gates)22.1 ms110 ms850 KB
PSI (220 items)KKRT + OT ext.22.8 s12 s42 MB
PSI (224 items)KKRT + OT ext.238 s145 s672 MB
Logistic Reg. (MNIST)ABY (mixed)20.3 s/epoch8 s/epoch~50 MB
ResNet-50 InferenceCrypTFlow224.1 s~60 s~600 MB
Sorting (106)3PC Shamir312 s~90 s~2 GB
Orders of magnitude: MPC is typically 103-106x slower than plaintext computation, with communication as the primary bottleneck. LAN vs. WAN can differ by 10-50x due to round-trip latency. Protocol choice heavily depends on network conditions.

Code: Shamir Secret Sharing

A complete implementation of Shamir's (t, n)-threshold secret sharing over a prime field.

  import secrets

  def shamir_share(secret: int, t: int, n: int, p: int) -> list:
      """Split secret into n shares with threshold t+1."""
      # Random polynomial: f(x) = secret + a1*x + a2*x^2 + ... + at*x^t
      coeffs = [secret] + [secrets.randbelow(p) for _ in range(t)]

      def eval_poly(x):
          return sum(c * pow(x, i, p) for i, c in enumerate(coeffs)) % p

      return [(i, eval_poly(i)) for i in range(1, n + 1)]

  def lagrange_interpolate(shares: list, p: int) -> int:
      """Reconstruct secret from t+1 shares using Lagrange interpolation."""
      secret = 0
      for i, (xi, yi) in enumerate(shares):
          num, den = 1, 1
          for j, (xj, _) in enumerate(shares):
              if i != j:
                  num = (num * (-xj)) % p
                  den = (den * (xi - xj)) % p
          secret = (secret + yi * num * pow(den, -1, p)) % p
      return secret

  # Example: (2, 5)-threshold sharing — need 3 of 5 shares
  p = 2**127 - 1  # Mersenne prime
  shares = shamir_share(42, t=2, n=5, p=p)
  assert lagrange_interpolate(shares[:3], p) == 42   # Any 3 suffice
  assert lagrange_interpolate(shares[2:5], p) == 42   # Any 3 suffice
Production considerations: Use constant-time modular arithmetic. The prime p must be larger than the secret space. For MPC, use a field compatible with the computation (e.g., F261-1 for 64-bit arithmetic). Secret sharing alone does not provide integrity — combine with MACs for malicious security.

Code: Beaver Triple Multiplication

Two-party secure multiplication using precomputed Beaver triples over additive secret sharing.

  class Party:
      def __init__(self, x_share, a_share, b_share, c_share, p):
          self.x = x_share; self.a = a_share
          self.b = b_share; self.c = c_share; self.p = p

      def compute_masked(self, y_share):
          """Step 1: Compute and broadcast masked values."""
          self.d_share = (self.x - self.a) % self.p   # [d] = [x] - [a]
          self.e_share = (y_share - self.b) % self.p   # [e] = [y] - [b]
          return self.d_share, self.e_share

      def compute_product(self, d, e, is_party_1=False):
          """Step 2: Compute share of x*y from opened d, e."""
          # [x*y] = d*e + d*[b] + e*[a] + [c]
          result = (d * self.b + e * self.a + self.c) % self.p
          if is_party_1:
              result = (result + d * e) % self.p  # Only P1 adds d*e
          return result

  # Simulation: x=7, y=13, a=3, b=5, c=15 (c = a*b), p=97
  p = 97
  # Additive shares: x=7 → (2, 5), y=13 → (8, 5), etc.
  p1 = Party(2, 1, 3, 10, p)   # Party 1 shares
  p2 = Party(5, 2, 2, 5,  p)   # Party 2 shares
  d1, e1 = p1.compute_masked(8); d2, e2 = p2.compute_masked(5)
  d, e = (d1 + d2) % p, (e1 + e2) % p     # Open d=4, e=6
  z1 = p1.compute_product(d, e, True); z2 = p2.compute_product(d, e)
  assert (z1 + z2) % p == (7 * 13) % p     # 91 mod 97 = 91 ✓

Current Research Frontiers

MPC research remains extremely active, pushing boundaries in efficiency, functionality, and new computational models.

Function-Hiding MPC

Standard MPC reveals the function f to all parties. Function-hiding MPC keeps f private too — only one party knows what is being computed. Built on garbled circuits + universal circuits or indistinguishability obfuscation.

Application: proprietary algorithms on outsourced data

Theoretical

Constant-Overhead MPC

Goal: MPC with communication overhead approaching O(|C|) — proportional to circuit size with constant factor. Recent breakthroughs:

Boyle et al. (2019): Pseudorandom correlation generators (PCG) — generate correlated randomness from short seeds using LPN assumptions. Silent OT: Near-zero communication OT extension.

Breakthrough

Fluid MPC

Parties can dynamically join and leave the computation. Eliminates the requirement for a fixed set of participants. Uses committee rotation and handoff protocols.

Motivated by blockchain / decentralized settings where participants change over time.

Emerging

MPC-in-the-Head

Simulate an MPC protocol "in your head" to construct zero-knowledge proofs. IKOS paradigm (2007) → BBQ, Limbo, SDitH. Foundation of the NIST PQC signature candidate SDitH (based on MPC-in-the-Head of syndrome decoding).

Cross-domain

Pseudorandom Correlation Generators (PCG): The most impactful recent development. Generate Beaver triples, OT correlations, and other precomputation from sublinear-size seeds. Reduces offline communication from O(|C|·k) to O(|C|) with only local computation. Based on LPN/Ring-LPN assumptions.

Summary

Foundations — Yao's Millionaires' Problem, ideal/real world paradigm, semi-honest vs. malicious security models, honest vs. dishonest majority thresholds.

Secret sharing — Shamir's polynomial-based (t, n)-threshold scheme, additive sharing (XOR and arithmetic), Beaver triples for multiplication with 2-round online phase.

Two-party protocols — Garbled circuits (Yao) with half-gates optimization (2 ciphertexts/AND), GMW gate-by-gate evaluation, oblivious transfer and OT extension (IKNP).

Multi-party protocols — BMR for constant-round n-party garbled circuits, BGW for Shamir-based honest majority, SPDZ for malicious security with information-theoretic MACs.

Applications — Private set intersection at scale (268M elements), privacy-preserving ML (ResNet-50 in 4.1s), secure auctions, threshold key management, ad measurement.

Frontiers — Pseudorandom correlation generators, silent OT, constant-overhead MPC, fluid MPC for dynamic participants, MPC-in-the-Head for zero-knowledge proofs.

Modern Cryptography Series · Module 12