arXiv:2605.22441cs.CRcs.AI2026-05

提出微控制器上恒定时间激活函数实现方法,防侧信道攻击。

A Constant-Time Implementation Methodology for Activation Functions on Microcontrollers

论文配图:A Constant-Time Implementation Methodology for Activation Functions on Microcontrollers
图 1 · 摘自论文原文
  • 用无分支选择和固定开销近似法实现恒定耗时计算。
  • 所有输入下耗时一致,88~108周期,抗模板攻击。
  • 适合嵌入式设备安全推理,尤其对时序敏感场景。

嵌入式神经网络推理可能通过时序侧信道泄露信息,尤其是激活函数的计算过程。本文提出一种在嵌入式微控制器上实现恒定时间激活函数的方法,并在ARM Cortex-M4平台上验证了ReLU、Sigmoid、Tanh、GELU和Swish。该方法结合无分支选择、固定成本的Padé逼近、必要时的虚拟运算及周期对齐,实现时序规整的激活函数。作为对比,评估了一种去同步化防护机制,发现其仍易受模板攻击。实验表明,所提方案在所有测试输入下均保持相同周期数:三函数设置为88周期,五函数设置为108周期。数值误差分析显示,近似非线性函数仍保持高精度。结果表明,该方法为嵌入式推理中构建抗侧信道攻击的激活函数提供了实用基础。

原文摘要 · Abstract (English)

Embedded neural-network inference can leak information through timing side channels, including leakage caused by the evaluation of activation functions. This work proposes a constant-time implementation methodology for activation functions on embedded microcontrollers and validates it on ReLU, sigmoid, tanh, GELU, and Swish on an ARM Cortex-M4 platform. The proposed methodology combines branchless selection, fixed-cost Padé-based approximation, dummy arithmetic where needed, and cycle alignment to obtain timing-regular activation-function implementations. As motivation, we also evaluate a desynchronization-based countermeasure and show that it remains vulnerable to a template-based timing attack. Experimental results show that the resulting protected implementations achieve identical cycle counts for all tested inputs, including (88) cycles in the three-function setting and (108) cycles in the five-function setting. At the same time, the numerical-error analysis indicates that the approximated nonlinear functions retain high accuracy. These results suggest that the proposed methodology provides a practical basis for constructing side-channel-resistant activation functions in embedded inference.

侧信道防御微控制器恒定时间神经网络部署

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。