GMW Protocol & Oblivious Transfer
Implement OT extension and the GMW multi-party protocol.
GMW Protocol & Oblivious Transfer is a free Cryptology Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
GMW: Multi-Party Secret Sharing Approach
The Goldreich-Micali-Wigderson (GMW) protocol evaluates Boolean circuits using XOR secret shares. Each wire value is split among all parties; they interact gate-by-gate.
XOR Secret Sharing in GMW
Party i holds share s_i such that s_1 ⊕ s_2 ⊕ ... ⊕ s_n = w (the true wire value). XOR gates are free: each party locally XORs their shares.
AND Gates Require Interaction
For an AND gate on wires a,b: computing (a_1⊕a_2)(b_1⊕b_2) expands to cross-terms. Evaluating the cross-term a_i·b_j between parties i≠j requires Oblivious Transfer.
Oblivious Transfer (OT) Definition
In a 1-out-of-2 OT, sender has messages (m_0, m_1), receiver has choice bit c. Receiver gets m_c; sender learns nothing about c; receiver learns nothing about m_{1-c}.
Naor-Pinkas OT Protocol
Based on Diffie-Hellman: receiver generates two public keys such that she knows the discrete log of only one. Sender encrypts each message under one key. Receiver decrypts only her chosen ciphertext.
OT Extension: Doing OT Cheaply
Ishai et al. (2003): from k base OTs, generate m >> k OTs using only symmetric-key operations. IKNP extension reduces OT cost to ~3 AES calls per OT after a one-time setup.
GMW with OT Extension
Each AND gate needs one OT per party pair. With OT extension, pre-computing all OTs in an offline phase allows the online phase to be a single XOR exchange per gate.
Malicious Security via Cut-and-Choose
Semi-honest GMW can be made malicious-secure using zero-knowledge proofs or cut-and-choose OT. The cost increases by 3-8× but guarantees security against cheating parties.
Committed OT and Authenticated Shares
MASCOT (Keller et al.) extends OT to produce authenticated AND triples in the malicious model, enabling the SPDZ protocol — covered in the next lesson.
Practical Libraries
EMP-toolkit and MOTION implement GMW with OT extension. They achieve millions of AND gates per second between two parties over a LAN, making real applications feasible.
Knowledge Check
Why do XOR gates in the GMW protocol require no communication between parties?
Lesson Recap
GMW uses XOR secret shares over Boolean circuits. XOR gates are free; AND gates need OT. OT extension makes OT cheap. Malicious security adds ZKPs or cut-and-choose. Libraries like EMP achieve practical throughput for real applications.
Frequently asked questions
Is the “GMW Protocol & Oblivious Transfer” lesson free?
Yes — the full text of “GMW Protocol & Oblivious Transfer” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.
What will I learn in “GMW Protocol & Oblivious Transfer”?
Implement OT extension and the GMW multi-party protocol. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cryptology Academy?
No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “GMW Protocol & Oblivious Transfer” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cryptology Academy lesson?
Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- MPC Problem & Yao's Garbled Circuits
- GMW Protocol & Oblivious Transfer
- SPDZ & Arithmetic MPC over Secret Shares
- MPC Applications: Private Set Intersection & ML