Transactions on Cryptographic Hardware and Embedded Systems 2026
ARMOR:
First-Order Masking of Activation and ArgMax Gadgets for Side-Channel Resistant Neural Networks
README
ARMOR: First-Order Masking of Activation and ArgMax Gadgets for Side-Channel Resistant Neural Networks
This artifact provides an implementation of our paper ARMOR: First-Order Masking of Activation and ArgMax Gadgets for Side-Channel Resistant Neural Networks accepted at TCHES 2026, Issue 2.
The artifact includes:
- Information loss analysis for Masked BNN (784-512-10)
- Clock cycle measurement for BNN (784-512-10)
Requirements
Tested on:
- Ubuntu 22.04 LTS
- x86_64 CPU (Intel/AMD) supporting RDTSCP
- GCC (must support x86 intrinsics)
System dependencies:
- OpenSSL development package (libcrypto)
The MNIST dataset files required for our experiments were converted into a single combined file containing both images and labels:
data/combined.bytes
This artifact uses the MNIST dataset, which is third-party material.
The file data/combined.bytes is derived from the MNIST dataset.
MNIST is distributed under the Creative Commons Attribution-Share Alike 3.0 license.
Source: http://yann.lecun.com/exdb/mnist/
Running the Experiments
Build
Compile the project with:
make
Run
This artifact provides two evaluation modes:
- Mean Clock Cycle Measurement (
run_clock) - Information Loss Calculation (
run_accuracy)
The desired mode is selected via a command-line argument:
0→ run_clock()1→ run_accuracy()
Additionally, the user can select the MNIST dataset size, up to a maximum of 10,000 samples.
For example, to run the accuracy loss measurement with 10,000 MNIST samples illustrated in Table 4:
./test 1 10000
The expected result includes label loss, which measures whether the predicted label differs from the true label:
hidden layer node loss: 0
hidden layer loss: 0
output layer loss: 0
output loss: 0
label loss: 1097