International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems 2026

Secret Key Recovery of FALCON using Simple Power Analysis in Conditional Calculator


README

Secret Key Recovery of FALCON using Simple Power Analysis in Conditional Calculator

This repository contains code, scripts, and data needed to reproduce the main results of our FALCON side-channel analysis using simple power analysis on a conditional calculator implementation.

Scope

Quickstart

  1. Clone the repository with submodules:
git clone --recurse-submodules https://github.com/ks950909/FALCON_CC_SPA.git
cd FALCON_CC_SPA

If you already cloned without submodules, run:

git submodule update --init --recursive
  1. Install dependencies (toolchain + Python). See Requirements below.
  2. (Optional) Select a prebuilt firmware image for ChipWhisperer capture.
  3. Prepare the required CC trace files under trace/full/. These large .npy files are not included in a fresh Git clone and must be obtained separately from the dataset release / Zenodo before running the CC pipeline.
  4. Run the analysis script on the provided trace subset. Local execution requires Python 3.11. If your system python3 is older, use the provided Docker workflow instead. Before running the Falcon pipeline that uses host-side executables, build the required binaries from source:
cmake -S csrc -B csrc/build -DCMAKE_BUILD_TYPE=Release
cmake --build csrc/build -j

This produces the required executables in bin/.

Example (adjust paths/commands for your environment):

# prebuilt firmware paths (examples)
# CC variants:   fw/SPA_CC/FALCON_SPA_O{0,1,2,3,s}-CW308_STM32F4.hex
# Falcon target: fw/SPA_FALCON/FALCON_fpr_SPA-CW308_STM32F4.hex

# run analysis on trace subset
python ./python/main_cc.py --config ./configs/main_cc.yaml
python ./python/main_falcon.py --config ./configs/main_falcon.yaml

Docker (CC pipeline):

docker build -f Dockerfile.cc -t falcon-cc .
docker run --rm -it \
  -v "$PWD/trace:/work/trace" \
  -v "$PWD/outputs:/work/outputs" \
  -v "$PWD/configs:/work/configs" \
  falcon-cc

Docker (Falcon pipeline, using prebuilt C binaries on host):

cmake -S csrc -B csrc/build -DCMAKE_BUILD_TYPE=Release
cmake --build csrc/build -j

docker build -f Dockerfile.falcon -t falcon-falcon .
docker run --rm -it \
  -v "$PWD/bin:/work/bin" \
  -v "$PWD/trace:/work/trace" \
  -v "$PWD/outputs:/work/outputs" \
  -v "$PWD/configs:/work/configs" \
  falcon-falcon

Docker (Figure generation: FPR add region plot):

docker build -f Dockerfile.fpr_add_region_plot -t fpr-add-region .
docker run --rm -v "$PWD/outputs:/work/outputs" fpr-add-region

Requirements

Repository Layout

Reproducibility Notes

Additional CC Experiments (Optional)

Countermeasure Overhead

Compiler Flags

Data / Traces

Dataset Preparation

cat trace_fpr_add.npy.part_* > trace_fpr_add.npy

Outputs

Mapping to Paper Results

Optional Falcon Experiments

Optional Falcon stages are controlled by configs/main_falcon.yaml.

Under postproc_cpp, the following optional post-processing tests are available:

Recommended usage:

For evaluation, enabling one test at a time is the easiest way to interpret the resulting logs, although one or more tests can be enabled.

Troubleshooting

License and Citation