TL;DR
TinyGarble2 is a C++ framework for privacy-preserving computation using Yao's Garbled Circuit protocol. It offers a significant leap in performance and scalability for secure multi-party computation, particularly for complex tasks like neural network inference, by optimizing memory usage and execution speed.
What Problem Does This Paper Address?
Multi-Party Computation (MPC) allows multiple parties to jointly compute a function without revealing their private inputs. Yao's Garbled Circuit (GC) is a highly efficient MPC protocol for two parties, but its practical application is often hindered by high memory requirements and slow execution times, especially for large computations like those in deep learning. Existing frameworks often excel in only a few aspects (speed, scalability, programming ease) but not all. This paper addresses the need for a GC framework that is simultaneously fast, memory-efficient, scalable, and provides a user-friendly programming interface, particularly for complex applications like Convolutional Neural Networks (CNNs).
Methods
TinyGarble2 builds upon its predecessor, TinyGarble, by introducing a two-layer architecture:
- GC Back-end: This layer handles the core GC protocol execution. It supports both honest-but-curious and malicious security models with identical interfaces, offering flexibility. A key innovation is its memory management, which ensures only a limited number of garbled gates reside in memory at any given time, drastically improving scalability. It also supports heterogeneous loops, allowing for more complex program structures than previous sequential GC approaches.
- Programming Interface: This layer provides a rich C++ library of common arithmetic and logical building blocks. Developers can use these blocks to construct applications without needing to write in Hardware Description Languages (HDLs). The framework pre-compiles optimized netlists for these operations, allowing developers to benefit from HDL-level efficiency while programming in C++.
The framework also introduces specialized "Neural Network Building Blocks" for CNN inference, including custom implementations for convolution and fully connected layers that directly interface with the GC back-end.
Datasets
The paper evaluates TinyGarble2's performance on the MNIST dataset using a pre-trained, quantized LeNet-5 CNN model. No new datasets were introduced.
Key Insights and Ideas
- Abstraction is Key: The two-layer design (back-end execution + programming interface) is crucial for balancing performance and usability. Developers get the benefits of optimized low-level GC execution without the complexity of HDLs.
- Memory Management for Scalability: The novel approach to managing garbled gates in memory is the primary driver for TinyGarble2's scalability, making it feasible to run complex computations that were previously intractable.
- Heterogeneous Loops Unlock Complexity: Supporting heterogeneous loops allows TinyGarble2 to handle more realistic and complex computational structures, moving beyond the limitations of homogeneous loops in prior work.
- Pre-compiled Netlists for Efficiency: Leveraging pre-compiled, optimized netlists from HDL synthesis tools, combined with a C++ interface, provides a significant speedup over frameworks that generate netlists at runtime.
Key Results
- Matrix Multiplication: TinyGarble2 demonstrates competitive performance in matrix multiplication, being faster than ABY and comparable to Obliv-C in speed, while using less memory than ABY and significantly less than Obliv-C for larger matrix sizes.
- CNN Inference (LeNet-5): This is where TinyGarble2 truly shines. For inference on the MNIST dataset using LeNet-5:
- TinyGarble2 achieved a run-time of 91.11 seconds with a peak memory usage of 45.83 MB (using variable bit-widths).
- In comparison, Obliv-C took 3010 seconds (over 50 minutes) and used 127.73 MB of memory.
- This represents a speedup of up to 33.1x and a memory reduction of 64% compared to Obliv-C.
- Overall Performance: TinyGarble2 is reported as the fastest among current end-to-end GC frameworks and is scalable in terms of memory footprint.
Limitations and Future Work
- Malicious Model Trade-off: While TinyGarble2 supports the malicious security model, there's a trade-off: the number of Oblivious Transfers (OT) increases, potentially impacting runtime. However, the framework offers flexibility by allowing more OT extension invocations to reduce memory usage.
- Variable Bit-Widths: For variables exceeding 64 bits, developers need to manually merge multiple integers, which could be a point of friction.
- Future Work: The paper doesn't explicitly detail future work, but the success with CNNs suggests extending the framework to support other complex machine learning models and exploring further optimizations for the malicious security model would be natural next steps.
Summary updated