Skip to content

HyCaMi: High-Level Synthesis for Cache Side-Channel Mitigation

Notifications You must be signed in to change notification settings

encryptogroup/HyCaMi

Repository files navigation

HyCaMi

HyCaMi: High-Level Synthesis for Cache Side-Channel Mitigation

By Heiko Mantel¹, Joachim Schmidt², Thomas Schneider², Maximilian Stillger², Tim Weißmantel¹, Hossein Yalame²MAIS, TU Darmstadt ²ENCRYPTO, TU Darmstadt) in Design Automation Conference (DAC'24). Paper available here.

Structure

This repository contains code and artifacts for reproducing our results.

  • GitHub releases
    • XLS High-Level Synthesis toolchain
    • CacheAudit v0.3
    • Unhardened and hardened block cipher source and binaries
    • Intermediate circuit files and C source artifacts
    • Analysis data spreadsheets
  • Repository
    • Hardening workflow
    • LUT merging
    • LUT2C

Instructions

The following instructions assume an Ubuntu 22.04 system. For other Linux distributions, the steps may vary slightly.

  1. Setup
  2. Executing hardening workflow
  3. Postprocessing and optimization of hardened C source
  4. Compilation of resulting C source
  5. Static side-channel analysis

Setup

Download and extract the artifacts from the release page.

sudo apt install build-essential yosys python3
make -C Bench2SHDL
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd CacheAudit
bash install.sh

Executing hardening workflow

This part of the workflow prepares circuits by compiling C code to a hardened C code.

# Evaluation/Comparison-RiCaSi-1.0 can be the path of the extracted release archive
cd Evaluation/Comparison-RiCaSi-1.0/cross_library_aes/2-Compilation/openssl
make -C src -f Makefile.Te

Postprocessing

python ../../inline.py src/Te0_f_lut6a_mo.c
make openssl-aes-wrapper-enc-Te

Analysis

Now we can perform two independent analysis.

Side-Channel Analysis

cd ../4-Side-Channel-Analysis-Of-Protected-Code/openssl/
make analysis

Correctness Check

cd ../3-Functional-Correctness/openssl/
python test.py

Disclaimer

This code is experimental and should not be used in production. We do not provide security guarantees.

About

HyCaMi: High-Level Synthesis for Cache Side-Channel Mitigation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages