interplane.Get Omega
Read in your language

aien-receipts

Append-only AIEN verification receipts, indexed by repository and exact source commit. Read verdicts, signatures and retained logs before making a claim.

Brought by drakestapleton

branch main Branches Tags History

aien-receipts / audit / tls / omega-mv / rerun.sh

55 lines · 2952 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: Apache-2.0
3# Rerun the om/tls proof pack from scratch on an arm64 Linux host with git, gcc, python3 and openssl.
4# Usage: sh rerun.sh [WORKDIR] [--bench]
5# 1. reproducible build: two fresh clones of the tested commit, compiler and test binaries compared
6# 2. every om/tls suite on the tested commit (unit suites, TLS, ACVP sample vectors)
7# 3. the same on the draft branches (NODELAY + ACVP #844, FIPS self-tests #846, approved mode #847)
8# 4. with --bench: the HTTPS benchmark (needs cargo for the rustls arm, about 20 min, pin cores first)
9# Each step prints its suite's final line; compare them with the logs in this directory.
10set -eu
11here=$(cd "$(dirname "$0")" && pwd)
12work=${1:-$PWD/tls-proof-rerun}
13url=https://github.com/aien-dev/omega-mv.git
14tested=2d613b2d2f4650ae9b5a693b3fb4caffab0dea20
15mkdir -p "$work"
16
17echo "== 1. reproducible build at $tested"
18sh "$here/repro/repro-build.sh" "$tested" "$url" "$work/repro"
19
20suites() { # TREE: run every suite present in the tree, one at a time
21 (cd "$1" && sh seed/omega-from-seed.sh >/dev/null && sha256sum -c seed/out/omc.sha256 >/dev/null)
22 for s in sha2 x25519 chacha aesgcm ec rsa x509 ecdh drbg fips tls; do
23 [ -f "$1/om/tls/test/$s/run.sh" ] || continue
24 (cd "$1" && sh "om/tls/test/$s/run.sh" "$PWD/seed/out/omc" 2>&1 | tail -1)
25 done
26 if [ -f "$1/om/tls/test/acvp/run.sh" ]; then
27 (cd "$1" && sh om/tls/test/acvp/run.sh "$PWD/seed/out/omc" 2>&1 | tail -1) || true
28 fi
29}
30
31for ref in "$tested" audit/tls-proof audit/tls-fipsmodule audit/tls-approvedmode audit/tls-fips-approved; do
32 d="$work/tree-$(echo "$ref" | tr / -)"
33 [ -d "$d" ] || git clone -q "$url" "$d"
34 git -C "$d" fetch -q origin "$ref" 2>/dev/null || true
35 git -C "$d" checkout -q --detach "$( git -C "$d" rev-parse --verify -q "origin/$ref" || echo "$ref")"
36 echo "== 2/3. suites at $ref ($(git -C "$d" rev-parse HEAD))"
37 suites "$d"
38done
39
40if [ "${2:-}" = --bench ]; then
41 echo "== 4. HTTPS benchmark (frozen protocol: bench/PROTOCOL.md; clients on cpus 16 and 2, server on 18)"
42 b="$work/bench"; bin="$b/bin"; mkdir -p "$bin"
43 sh "$here/bench/gen-certs.sh" "$b/www"
44 t="$work/tree-audit-tls-proof"
45 (cd "$t" && sh om/tls/build.sh "$PWD/seed/out/omc" om/tls/test/bench/bench.om "$bin/omega")
46 a="$work/tree-asis"; [ -d "$a" ] || git clone -q "$url" "$a"
47 git -C "$a" checkout -q --detach "$tested"
48 cp "$t/om/tls/test/bench/bench.om" "$a/bench.om"
49 (cd "$a" && sh seed/omega-from-seed.sh >/dev/null && sh om/tls/build.sh "$PWD/seed/out/omc" bench.om "$bin/omega-asis")
50 gcc -O2 -o "$bin/openssl" "$here/bench/drivers/ossl_client.c" -lssl -lcrypto
51 cargo build -q --release --manifest-path "$here/bench/drivers/rustls_client/Cargo.toml" --target-dir "$b/rtarget"
52 cp "$b/rtarget/release/rustls_client" "$bin/rustls"
53 python3 "$here/bench/run.py" "$bin" "$b/www" "$b/results" 30 16,2
54 echo "Raw rows: $b/results/raw.jsonl. Statistics: bench/wolfram-*.wl, as RESULTS.md describes."
55fi