Files
crypto/mlkem/ct/dudect/run-m1-overnight.sh
zeekay aa7f471d97 chore: rename Comet → Magnetar (decomplect metaphor consistency)
Aligns hqc/slhdsa comments + dudect timing test docs with the canonical
PQ signature family naming:
  Pulsar (M-LWE threshold ML-DSA)
  Corona (R-LWE / Corona wrapper)
  Magnetar (SLH-DSA threshold via GF(257) Shamir)

Old name 'Comet' was the working title for Magnetar during early
development; this commit completes the rename in:
- hqc/hqc.go (family-disjoint gap comment)
- slhdsa/gpu.go (FIPS 205 GPU dispatch header)
- slhdsa/gpu_test.go (test descriptions)

Also includes:
- mlkem/ct/dudect/{decaps,encaps,keygen}_ct.go + .c — timing analysis
  harness improvements (decaps is the most CT-critical ML-KEM routine)
- mlkem/ct/dudect/run-m1-overnight.sh — operator runbook for Apple M1
  overnight timing analysis
- .gitignore — build artifacts (dudect/, *.dylib, *.so, results/)
2026-05-20 16:19:09 -07:00

47 lines
1.6 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# ML-KEM decaps dudect — Apple M1 overnight run (~14 hours for 10^9 samples)
#
# Methodology: 10000 samples/batch × 100000 batches = 10^9 samples.
# 100000 batches is the cap; dudect will exit early as DUDECT_LEAKAGE_FOUND
# or run to the cap and print "no leakage detected within budget".
#
# To get clean timing data on M1:
# - close all other apps before launching
# - plug in power
# - prevent sleep via `caffeinate -d -i -m`
# - disable Spotlight indexing: `sudo mdutil -a -i off` (re-enable after with `-i on`)
# - close Time Machine + iCloud sync
#
# Usage:
# ./run-m1-overnight.sh decaps # default
# ./run-m1-overnight.sh encaps
# ./run-m1-overnight.sh keygen
set -euo pipefail
TARGET="${1:-decaps}"
BIN="./dudect_${TARGET}"
[ -x "$BIN" ] || { echo "build first: make $TARGET"; exit 1; }
STAMP="$(date -u +%Y-%m-%dT%H-%M-%SZ)"
CPU="$(sysctl -n machdep.cpu.brand_string 2>/dev/null || uname -m)"
OS="$(uname -srm)"
TAG="m1-${TARGET}-${STAMP}"
LOG="results/${TAG}.log"
META="results/${TAG}.meta"
echo "==> ML-KEM ${TARGET} dudect run" | tee "$META"
echo " CPU: $CPU" | tee -a "$META"
echo " OS: $OS" | tee -a "$META"
echo " started: $STAMP" | tee -a "$META"
echo " samples/batch: 10000" | tee -a "$META"
echo " batch cap: 100000 (target 10^9 total samples)" | tee -a "$META"
echo " binary: $BIN" | tee -a "$META"
echo " log: $LOG" | tee -a "$META"
echo "" | tee -a "$META"
# Wrap with caffeinate to keep machine awake; redirect everything to log.
exec caffeinate -d -i -m \
env DUDECT_SAMPLES=10000 DUDECT_MAX_BATCHES=100000 \
"$BIN" 2>&1 | tee "$LOG"