TL;DR
This paper introduces the first hardware-software co-design for building side-channel attack-resistant neural network inference engines on edge devices. By extending the RISC-V instruction set and developing a reconfigurable coprocessor, they achieve a balance of performance and flexibility, enabling selective masking of neural network layers to protect sensitive model parameters.
What Problem Does This Paper Address?
Machine learning (ML) models are increasingly valuable intellectual property, making them targets for sophisticated attacks. Physical side-channel attacks, which exploit data-dependent power or electromagnetic emissions, are a significant threat to extracting these models from edge devices. Existing defenses fall into two camps: purely software-based solutions that lack efficiency, or hardware-centric approaches that are rigid and difficult to use. This leaves a gap for solutions that offer both high performance and the flexibility to adapt to different neural network architectures and security needs.
Methods
The core of this work is a hardware-software co-design approach built around the RISC-V architecture.
- Hardware: A secure RISC-V coprocessor is designed to execute neural network operations. It employs masking techniques to obscure sensitive computations. Crucially, it supports runtime reconfigurability, allowing individual layers to be selectively masked or unmasked. This is achieved by reusing datapath elements for unmasked layers to improve performance.
- Architecture: The RISC-V instruction set architecture (ISA) is extended with custom instructions (ISEs) to control the masking primitives within the coprocessor. These ISEs are integrated into the RISC-V toolchain (GCC, Binutils) to allow for their use in compiled code.
- Software: A user-friendly C-based API is provided as a shared library. This API abstracts away the complexity of the custom ISEs, allowing software developers familiar with ML models to easily integrate secure inference into their applications. The APIs are implemented internally using the custom ISEs.
- Masking Techniques: The design utilizes modular arithmetic for weighted summations and Boolean masking for activation and output layers, drawing on proven first-order secure primitives. For higher precision networks, they extend masking to operations like ReLU and maxpooling.
Datasets
Not discussed in the paper. The paper focuses on the hardware and software design for secure inference, with evaluation performed on a custom setup rather than specific public datasets.
Key Insights and Ideas
- Hardware-Software Co-design is Key: The paper strongly advocates for a holistic approach, integrating hardware and software to achieve both performance and security, which neither approach can achieve alone for this problem.
- Runtime Reconfigurability for Security-Performance Trade-offs: The ability to selectively mask layers is a critical insight. This allows users to balance security needs with performance requirements, masking only the most vulnerable or sensitive parts of the network.
- RISC-V as a Flexible Platform: The choice of RISC-V is highlighted for its modularity and open-source nature, making it amenable to custom instruction extensions and toolchain modifications.
- Abstraction is Crucial for Usability: Providing a high-level API makes the complex hardware-level security features accessible to ML developers without requiring deep expertise in side-channel attacks or hardware design.
- Masking is Not One-Size-Fits-All: The paper demonstrates that different layers and different types of operations (e.g., weighted summation vs. activation) require tailored masking strategies, and that higher precision networks introduce new masking challenges.
Key Results
- Side-Channel Security: The masked design successfully resists targeted DPA attacks, showing no statistically significant leakage even after 1M traces, while the unmasked version exhibits clear leakage. TVLA results also confirm that masking effectively hides information leakage across various configurations.
- Performance: The masked design incurs a performance overhead, with masked operations taking approximately twice as long as unmasked ones due to the dual datapath reuse optimization. However, this is presented as a trade-off for enhanced security.
- Area: The design's area breakdown shows the SNNU (Secure Neural Network Unit) as the largest contributor, with a total of 3981 FFs and 4797 LUTs on a Spartan-6 FPGA.
- Usability: The paper demonstrates the ease of use through a C-based API, allowing for sequential configuration and execution of neural network layers.
Limitations and Future Work
- Limitations:
- The paper acknowledges that the security proofs are based on the glitch-extended probing model, and invasive attacks (clock glitching, laser fault injection) are not addressed.
- The current implementation focuses on specific neural network architectures (MLPs) and does not fully explore all types of convolutional operations.
- The security of share conversion mechanisms is crucial and relies on prior work.
- Future Work:
- The authors suggest extending the work to higher precision convolutional neural networks and exploring masking for more complex operations.
- They also propose that their mitigation techniques are applicable to other RISC-V based ML accelerators, and further research is needed to quantify the exact overheads in such systems.
- The paper mentions that while the current solution is efficient, further optimization for area and performance is possible.
Summary updated