SLOTHY Tutorial - CHES 2025

September 11, 2025 ยท View on GitHub

This repository contains hands-on assignments for the SLOTHY tutorial at CHES 2025. SLOTHY is a constraint-solving assembly superoptimizer.

SLOTHY repository: https://github.com/slothy-optimizer/slothy
SLOTHY paper: https://tches.iacr.org/index.php/TCHES/article/view/11241

Tutorial Slides

The tutorial slides can be found at: https://kannwischer.eu/talks/20250914_slothy.pdf

Prerequisites

  • Python 3.8 or higher
  • MacOS or Linux

Setup

1. Clone this repository

git clone https://github.com/[username]/ches2025-slothy-tutorial.git
cd ches2025-slothy-tutorial

2. Create a Python virtual environment

python3 -m venv venv
source venv/bin/activate

3. Install SLOTHY

pip install -r requirements.txt

This will install SLOTHY version 0.1.5 and all its dependencies.

Assignments

Each assignment has its own README with detailed instructions. Start with Assignment 1 and work your way through.

  • Assignment 1 (01basic/): Basic straight-line code optimization of polynomial addition from ML-KEM.
  • Assignment 2 (02basemul/): Loop optimization with software pipelining for ML-DSA basemul.
  • Assignment 3 (03keccak/): Optimize the Keccak permutation (SHA-3).
  • Assignment 4 (04instruction/): Add support for a new instruction to SLOTHY (requires local SLOTHY clone, not pypi version).
  • Assignment 5 (05fusion/): Advanced - implement macro operation fusion for Apple M1.

Getting Help