mirror of
https://github.com/luxfi/security.git
synced 2026-10-30 15:17:20 +00:00
- ADVERSARIAL-MATRIX.md: 5-verifier per-primitive attack matrix + the four assurances - RELEASE-MANIFEST.toml pinned to final SHAs (consensus ConsensusCert envelope now on main) - gate upgrades: ec-machine-check.sh (compiles every .ec), comment-aware axiom-budget, PASS_WITH_OPEN_ASSUMPTIONS verdict + open_assumptions; p3q redteam cmd fixed - EC-toolchain-live corrections; corona C11 = lemma; gate-results regenerated (verdict PASS_WITH_OPEN_ASSUMPTIONS)
97 lines
5.3 KiB
Bash
Executable File
97 lines
5.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# prove-release.sh -- the "once and for all" release-proof command.
|
|
#
|
|
# Runs the full assurance gate over a FROZEN release manifest and emits a
|
|
# machine-readable report next to the manifest. It proves the release "under
|
|
# stated assumptions": it does NOT discharge Bucket-C assumptions (those are
|
|
# disclosed in CLAIMS.md and signed off externally) -- it proves that, at the
|
|
# pinned commits, the tests pass, the gates pass, the red-team PoCs fail closed,
|
|
# and no claim drifted.
|
|
#
|
|
# prove-release.sh <release-dir-or-manifest>
|
|
#
|
|
# Emits <release-dir>/gate-results.json and prints PASS / FAIL.
|
|
set -uo pipefail
|
|
ARG="${1:?usage: prove-release.sh <release-dir|RELEASE-MANIFEST.toml>}"
|
|
DIR="$ARG"; [ -f "$ARG" ] && DIR="$(dirname "$ARG")"
|
|
MAN="$DIR/RELEASE-MANIFEST.toml"
|
|
[ -f "$MAN" ] || { echo "no RELEASE-MANIFEST.toml in $DIR"; exit 2; }
|
|
FW="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
LUXFI="$(cd "$FW/../.." && pwd)" # .../luxfi
|
|
OUT="$DIR/gate-results.json"
|
|
OVERALL=0
|
|
|
|
# repo -> the test command (honest, repo-specific invocation).
|
|
testcmd() { case "$1" in
|
|
pulsar) echo "go test ./ref/go/pkg/pulsar/ -count=1";;
|
|
corona) echo "go test ./... -count=1";;
|
|
magnetar) echo "CGO_ENABLED=1 go test ./... -count=1";;
|
|
consensus) echo "GOWORK=off go test ./protocol/quasar/ -count=1";;
|
|
p3q) echo "cargo test --workspace";;
|
|
esac; }
|
|
|
|
emit() { # repo gate tests redteam -> JSON object fields
|
|
printf ' "%s": { "commit": "%s", "gate": "%s", "tests": "%s", "redteam": "%s" }' \
|
|
"$1" "$(git -C "$LUXFI/$1" rev-parse --short HEAD 2>/dev/null)" "$2" "$3" "$4"
|
|
}
|
|
|
|
echo "==> prove-release: $(grep -m1 '^release' "$MAN" | cut -d'"' -f2)"
|
|
echo "{" > "$OUT"
|
|
echo " \"release\": \"$(grep -m1 '^release' "$MAN" | cut -d'"' -f2)\"," >> "$OUT"
|
|
echo " \"repos\": {" >> "$OUT"
|
|
first=1
|
|
for repo in pulsar corona magnetar consensus p3q; do
|
|
RP="$LUXFI/$repo"; [ -d "$RP" ] || continue
|
|
echo " -- $repo"
|
|
# 1. framework assurance gate
|
|
gate=pass; bash "$FW/check.sh" "$RP" >/dev/null 2>&1 || { gate=fail; OVERALL=1; }
|
|
# 2. tests
|
|
tests=pass
|
|
( cd "$RP" && eval "$(testcmd "$repo")" ) >/dev/null 2>&1 || { tests=fail; OVERALL=1; }
|
|
# 3. red-team regression PoCs (must PASS = the attacks fail closed)
|
|
redteam=na
|
|
if [ "$repo" = consensus ]; then
|
|
redteam=pass; ( cd "$RP" && GOWORK=off go test ./protocol/quasar/ -run Redteam -count=1 ) >/dev/null 2>&1 || { redteam=fail; OVERALL=1; }
|
|
elif [ "$repo" = p3q ]; then
|
|
# cargo takes ONE positional filter; run each F-class separately (the corpus
|
|
# is F1-F4 = 7 tests). A multi-positional `cargo test ... f1_ f2_` errors and
|
|
# was the cause of the prior spurious redteam=warn.
|
|
redteam=pass; for f in f1_ f2_ f3_ f4_; do ( cd "$RP" && cargo test --workspace -- "$f" ) >/dev/null 2>&1 || redteam=warn; done
|
|
fi
|
|
echo " gate=$gate tests=$tests redteam=$redteam"
|
|
[ $first -eq 1 ] && first=0 || echo "," >> "$OUT"
|
|
emit "$repo" "$gate" "$tests" "$redteam" >> "$OUT"
|
|
done
|
|
echo "" >> "$OUT"; echo " }," >> "$OUT"
|
|
# Bucket-C open assumptions -- PASS proves the release UNDER these, it does NOT
|
|
# discharge them. Listed explicitly so "verdict: PASS" can never be read as
|
|
# "fully proven".
|
|
echo " \"open_assumptions\": [" >> "$OUT"
|
|
echo " \"reconstruct-then-sign byte-equality bridges (pulsar combine_body_axiom; corona combine_body_spec / sign_abs_op_lifted_eq_rlwe): EC-machine-checked CONDITIONAL on these, NOT discharged -- Jasmin byte-walk decomposition is the closure path. NOTE: corona's combine bridge combine_abs_op_lifted_eq_rlwe was DISCHARGED to a lemma (secret-bearing z-leg proven via the no_leak_z_aggregate keystone); its only residual is the narrow PUBLIC-commitment axiom threshold_public_commitment_eq_central (w=A*y agreement, no c*s)\"," >> "$OUT"
|
|
echo " \"no_leak_reduction (pulsar, corona): standard Module-LWE/Module-SIS reduction -- algebraic core machine-checked in Lean, full simulation-soundness open (v0.8.0)\"," >> "$OUT"
|
|
echo " \"FRI proximity-gap soundness (p3q): standard STARK assumption -- stated, not proven\"," >> "$OUT"
|
|
echo " \"honest-validator threshold (consensus): BFT majority assumption\"," >> "$OUT"
|
|
echo " \"SLH-DSA hash-family / FORS-WOTS+ EU-CMA (magnetar): standard hash-based assumption\"" >> "$OUT"
|
|
echo " ]," >> "$OUT"
|
|
echo " \"verdict_meaning\": \"all framework gates (incl. EasyCrypt ec-machine-check) + tests + red-team PoCs hold at the pinned commits, and no claim drifted; the Bucket-C open_assumptions above are DISCLOSED, NOT discharged; this is NOT 'fully proven'; external cryptographic sign-off pending\"," >> "$OUT"
|
|
# Verdict enum. PASS is never bare -- a clean run still carries open assumptions,
|
|
# so success is PASS_WITH_OPEN_ASSUMPTIONS. PASS_FULLY_DISCHARGED is RESERVED for
|
|
# when open_assumptions is empty (or all entries are policy-allowed external
|
|
# standard assumptions); we do not emit it while any in-house residual remains.
|
|
if [ $OVERALL -ne 0 ]; then
|
|
VERDICT="FAIL"
|
|
else
|
|
VERDICT="PASS_WITH_OPEN_ASSUMPTIONS"
|
|
fi
|
|
echo " \"verdict\": \"$VERDICT\"" >> "$OUT"
|
|
echo "}" >> "$OUT"
|
|
|
|
echo
|
|
echo "report: $OUT"
|
|
if [ $OVERALL -eq 0 ]; then
|
|
echo "PASS_WITH_OPEN_ASSUMPTIONS: all gates/tests/red-team hold at pinned commits; Bucket-C open_assumptions disclosed (NOT discharged); external sign-off pending. NOT 'fully proven'."
|
|
exit 0
|
|
fi
|
|
echo "FAIL: a gate / test / red-team PoC did not hold at the pinned commits."
|
|
exit 2
|