Files
zeekay c79fe61d62 consolidate: merge pulsar-mptc submission framework into canonical luxfi/pulsar
Single repo, one canonical impl + spec + proofs + KAT + cut tool.

Per "ONE and ONLY ONE way to do things" the prior dual-repo split
(luxfi/pulsar = production library, luxfi/pulsar-mptc = NIST MPTC
submission framework) is collapsed into a single canonical home at
github.com/luxfi/pulsar. SINGLE-IMPL-PLAN.md (now marked COMPLETED)
describes the steps; this commit lands the final step.

Files moved (89 new):
  16 submission docs (SUBMISSION, NIST-SUBMISSION, SPEC, SUITE,
     PATENTS, AXIOM-INVENTORY, PROOF-CLAIMS, FIPS-TRACEABILITY,
     TRUSTED-COMPUTING-BASE, HANZO-CRYPTO-SUITE, INFORMATION-
     ARCHITECTURE, ROADMAP, CHANGELOG, SYNC-STATUS, STATUS-
     SUBMISSION-READINESS, SINGLE-IMPL-PLAN)
  10 docs/ supplements (ietf-draft-skeleton, magnetar, evaluation,
     patent-claims, x-wing-sig, design-decisions, family-architecture,
     threat-model, nist-mptc-category, patent-notes-draft)
  19 proofs/ (13 EC theories + 2 EC lemmas + 4 metadata/READMEs +
     lean-easycrypt-bridge.md)
  14 jasmin/ (lib/* + ml-dsa-65 fetch + threshold/{combine,round1,
     round2}.jazz + READMEs)
  10 ct/dudect/ (Makefile, combine_ct.go, dudect_combine.c,
     dudect_compat.h, dudect_verify.c, fetch.sh, README, run-
     submission.sh, verify_ct.go) + ct/jasmin-ct-libjade.md
  1 .github/workflows/ci.yml
  1 test/interoperability/n1_class_test.go (19/19 N1 subtests)
  1 bench/results/REPORT.md
  11 scripts/ (cut-submission, check-high-assurance, check-lean-
     bridge, nightly, extract-jasmin-ec, checks/{ec-admits, ec-
     compile, ec-refinement-scaffold, ec-regressions, extraction,
     jasmin}, checks/test/{go-unit, interop, kat, no-secret-logs})

Files merged (16 overlapping, mptc-canonical chosen because newer +
post-rewire-correct; pulsar versions still bore stale "Pulsar-M" /
"pulsarm" branding):
  README.md, BLOCKERS.md, CONTRIBUTING.md, LICENSE, LICENSING.md,
  SECURITY.md, .gitignore, bench/run_all.sh, vectors/dkg.json (v1.0.7
  regen), scripts/{bench,build,gen_vectors,sbom,test}.sh,
  spec/{pulsar,parameters,system-model}.tex,
  CRYPTOGRAPHER-SIGN-OFF.md (path refs).

Pulsar-only spec supplements preserved:
  spec/{blockers,design-decisions,family-architecture,nist-mptc-
  category,patent-notes,threat-model}.tex.

Path rewrites applied: 158 occurrences across 26 files
  github.com/luxfi/pulsar-mptc -> github.com/luxfi/pulsar
  ~/work/lux/pulsar-mptc/      -> ~/work/lux/pulsar/
  luxfi/pulsar-mptc            -> luxfi/pulsar
  pulsar-mptc/                  -> ./

Narrative collapses (no more two-repo framing):
  SUBMISSION.md "At a glance" — single Repository row
  SYNC-STATUS.md — rewritten to single-repo state
  SINGLE-IMPL-PLAN.md — marked COMPLETED 2026-05-18
  HANZO-CRYPTO-SUITE.md — tier 1 row = single canonical home
  scripts/cut-submission.sh — replace/vendor dance removed; cuts
  directly from in-tree canonical sources

go.mod: dropped mptc's replace directive (no longer needed since this
IS the canonical pulsar repo). Module path is github.com/luxfi/pulsar.
Deps: cloudflare/circl v1.6.3, golang.org/x/crypto v0.32.0.

Verification:
  GOWORK=off go build ./...              PASS
  GOWORK=off go test -count=1 ./...      PASS (1.4s)
  GOWORK=off go test -race ./ref/...     PASS (14.7s)
  go test ./test/interoperability/       PASS (19/19 N1 subtests)
  scripts/check-high-assurance.sh        PASS
  scripts/check-lean-bridge.sh           PASS (5/5 bridges)
  scripts/gen_vectors.sh                 byte-identical replay
  scripts/cut-submission.sh --help       PASS
2026-05-18 19:53:08 -07:00

86 lines
2.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# scripts/checks/ec-compile.sh — EasyCrypt compile gate for all
# tracked EC files.
#
# Runs `easycrypt compile` on each file in EC_FILES and fails the
# gate if any reports [critical] (which `easycrypt compile` emits
# to stderr even when the exit code is 0). Skips silently if
# easycrypt is not installed.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
EC_ROOT="$REPO_ROOT/proofs/easycrypt"
EC_FILES=(
"$EC_ROOT/Pulsar_N1.ec"
"$EC_ROOT/Pulsar_N4.ec"
"$EC_ROOT/lemmas/Pulsar_CT.ec"
"$EC_ROOT/lemmas/MLDSA65_Functional.ec"
"$EC_ROOT/Pulsar_N1_Memory.ec"
"$EC_ROOT/Pulsar_N1_Signature_Codec.ec"
"$EC_ROOT/Pulsar_N1_Combine_Layout.ec"
"$EC_ROOT/Pulsar_N1_Sign_Layout.ec"
"$EC_ROOT/Pulsar_N1_Combine_Refinement.ec"
"$EC_ROOT/Pulsar_N1_Sign_Refinement.ec"
"$EC_ROOT/Pulsar_N1_Combine_Wrapper.ec"
"$EC_ROOT/Pulsar_N1_Sign_Wrapper.ec"
"$EC_ROOT/Pulsar_N1_Extracted.ec"
)
if ! command -v easycrypt >/dev/null 2>&1; then
echo "==> EasyCrypt compile gate"
echo " [skip] easycrypt not on PATH"
echo " install (source build): https://github.com/EasyCrypt/easycrypt"
exit 0
fi
EC_HASH=$(easycrypt config 2>&1 | grep "git-hash" | head -1)
echo "==> easycrypt found ($EC_HASH)"
# Use the EXIT CODE of easycrypt, not the grep of its stderr.
# Earlier versions of this script grepped for `[critical]` in the
# combined stdout/stderr, but easycrypt's stderr buffering races
# with the grep pipeline (the [critical] line is sometimes flushed
# AFTER easycrypt exits, after grep has already returned NO_MATCH),
# producing false [ok] reports. Exit codes are deterministic:
# easycrypt exits 0 on success, non-zero on any error.
EC_FAIL=0
EC_FAIL_LIST=()
for f in "${EC_FILES[@]}"; do
if [[ ! -f "$f" ]]; then
echo " [warn] missing: $f"
continue
fi
# Capture stderr so we can show it on failure without polluting
# the [ok] case. Compile in a subshell so any non-zero exit
# doesn't trip the script's set -e before we branch.
log="/tmp/ec-compile-$$.$(basename "$f").log"
rc=0
easycrypt compile -I "$EC_ROOT" -I "$EC_ROOT/lemmas" "$f" \
> "$log" 2>&1 || rc=$?
if [[ $rc -eq 0 ]]; then
echo " [ok] $f compiles"
rm -f "$log"
else
echo " [FAIL] $f (rc=$rc) — last lines of easycrypt output:"
# Strip the carriage-return-laden progress bar so the error
# message is readable. The [critical] tag usually follows
# the last progress update on the same physical line.
tr '\r' '\n' < "$log" | grep -E "\[critical\]|^[[:space:]]*unknown|error" | head -5 | sed 's/^/ /'
EC_FAIL=1
EC_FAIL_LIST+=("$f")
fi
done
if [[ $EC_FAIL -ne 0 ]]; then
echo
echo " EasyCrypt compile gate FAILED on ${#EC_FAIL_LIST[@]} file(s):"
for f in "${EC_FAIL_LIST[@]}"; do
echo " $f"
done
exit 2
fi
exit 0