Commit Graph
35 Commits
Author SHA1 Message Date
zeekay cb9fc02ca6 sign-off: cryptographer review of v1.0.7 — APPROVED WITH GATES
Independent review of luxfi/pulsar v1.0.7 (commit a2a4599) for both
live Lux Quasar consensus and the NIST MPTC v0.1 submission.

Approved with four disclosure / pre-publish gates:
  GATE-1  operator runbook discloses v0.1 reconstruction-aggregator trust model
  GATE-2  SUBMISSION.md cross-links the protocol-variant disclosure
  GATE-3  dudect runs to documented sample target (current results preliminary)
  GATE-4  minor doc updates (coverage %, spec text Ed25519 -> ML-DSA-65, etc.)

All gates are about documentation honesty or evidence-file completion;
none require algorithm or code changes. With those closed, the package
is fit to ship.

Construction is sound, identity-stage closure of CR-6/7/8 is uniform
across small and large committee paths, race-clean tests pass, KAT
vectors are deterministic, zeroization is in place, and the proof-
artifact gates (EasyCrypt admit budget 0/0, Lean<->EC bridge 5/5) are
green. Coverage measured at 84.2%.
2026-05-18 18:51:36 -07:00
zeekay bec7cab551 ref: close CR-6/7/8 on large-committee path — uniform identity stage
Port the small-committee (GF(257)) identity stage to the large-
committee (GF(q)) path so the entire library is uniform. After this
work, legacyDeriveMACKeyLarge is gone and the wire-format / sealing
primitives are shared across both paths.

  - identity.go: sealEnvelope / sealOpenEnvelope are now width-agnostic
    over the inner shareWire slice (64 bytes GF(257), 128 bytes GF(q)).
    The envelope key derivation, KEM ciphertext, KMAC256 auth tag and
    cSHAKE256 stream cipher are reused as-is.
  - large_types.go: drop LargeDKGShareEnvelope (use canonical
    DKGShareEnvelope); drop the vestigial Commits field on
    LargeDKGRound1Msg (CR-6 path A; binding comes from Round-2 digest).
  - large_dkg.go: NewLargeDKGSession takes (myIdentity, directory);
    Round1 KEM-wraps envelopes via sealEnvelope; Round3 opens them and
    derives the master seed from per-envelope contributions over GF(q)
    (no longer needs Lagrange interpolation of other recipients'
    envelopes).
  - large_threshold.go: NewLargeThresholdSigner takes sessionKeys;
    MAC keys are built from per-pair ephemeral session keys (CR-7).
    legacyDeriveMACKeyLarge deleted.
  - large_reshare.go: NewLargeReshareSession takes
    (myIdentity, newDirectory); Round1 KEM-wraps envelopes; Round3
    opens them; SetPriorGroupPubkey ported for new-committee joiners.

Tests updated to use the identityFixture pattern; large + small +
identity test suites all green, no race warnings, no KAT drift on
the small path (KAT vectors only fixate FIPS 204 sign/verify; the
wire envelope shape was already KEM-wrapped on the small path post-
merge).
2026-05-18 18:34:39 -07:00
zeekay 881c4e82d8 ref: merge pulsar-mptc submission-grade impl into canonical pulsar
Collapse the two parallel implementation trees (pulsar/ref/go/pkg/pulsar
and pulsar-mptc/ref/go/pkg/pulsar) per SINGLE-IMPL-PLAN.md by porting
the mptc submission-grade additions into the canonical pulsar tree.

New files (mptc-only, adopted verbatim):
  - identity.go / identity_test.go: long-term ML-KEM-768 + ML-DSA-65
    keypair, EstablishSession / DeriveSessionKey ephemeral key
    agreement, sealEnvelope / sealOpenEnvelope KEM-wrapped DKG
    envelope (BLOCKERS.md CR-6 / CR-7 / CR-8 closure)
  - n1_byte_equality_test.go: differential test asserting threshold
    Combine output is byte-identical to centralized FIPS 204 Sign
    under the reconstructed key — Class N1 manifesto headline
  - fuzz_test.go: go-test fuzz harness for AbortEvidence parsing,
    verify code paths, share parsing, params parsing
  - zeroize.go: best-effort secret-buffer wipe helpers

Adopted from mptc (security-grade superset; pulsar v0.1 fully
contained within):
  - abort.go / abort_test.go: identifiable-abort evidence parsing
    + per-kind structural validation + pluggable signature verifier
  - dkg.go / dkg_test.go: KEM-wrapped envelope DKG; NewDKGSession
    signature gains (myIdentity, directory) per CR-8
  - reshare.go / reshare_test.go: matching KEM-wrapped reshare;
    NewReshareSession signature gains (myIdentity, newDirectory)
  - threshold.go / threshold_test.go: ephemeral session-keyed MACs;
    NewThresholdSigner signature gains sessionKeys per CR-7;
    TestThresholdSwap_RejectedByCommitBind defense-in-depth proof
  - transcript.go: tagSignMask per-attempt mask derivation tag (H2);
    tagSignR2 commented out as RESERVED so a rebase can't silently
    reuse the name
  - shamir.go: DEPRECATED comment on byte-path shamirReconstruct;
    distribution-honesty comment on shamirEvalPoint
  - bench_test.go / kat_test.go: updated to new signatures
  - cmd/genkat/main.go: makeKATIdentities + makeKATSessionKeys for
    KAT regeneration under the new identity-based protocol

Reconciled (mptc base + pulsar preservation):
  - types.go: adopt mptc's KEM-wrapped DKGShareEnvelope (KEMCiphertext
    + Sealed fields, replacing v0.1 Share + Blind plaintext) and
    ephemeral MAC key comments, PRESERVING pulsar's Field type +
    FieldDefault / FieldGF257 / FieldGFq constants + String() +
    resolveField() helper for large-committee scalability

Preserved (pulsar-only, untouched):
  - large_dkg.go / large_threshold.go / large_reshare.go / large_types.go
    / large_e2e_test.go: GF(q) wide-committee parallel implementation
  - shamir_gfq.go / shamir_gfq_test.go: generic-field Shamir
  - largeshamir.go / largeshamir_test.go: large-committee Shamir
  - round.go / round_test.go: RoundContext / RoundSigner abstraction
    (tests updated to new identity-based threshold signer signature)
  - verify_batch.go / verify_batch_test.go: parallel batch verify
  - precompile_e2e_test.go: EVM precompile end-to-end (updated for
    new identity-based signer signature)
  - params.go: TargetCommitteeSize = 1_111_111 constant (unchanged)

Localised legacy compat:
  - large_threshold.go: legacyDeriveMACKeyLarge renamed from the
    removed package-level deriveMACKey; clearly tagged as v0.1
    pending a parallel large-committee identity layer

Build: GOWORK=off go build ./... clean
Tests: GOWORK=off go test ./... pass (119/119, including fuzz seeds
       for AbortEvidence / VerifySignature / VerifyCtx / ShareFromBytes
       / ParamsFor / N1_ByteEquality_Differential)
Race:  -race clean
2026-05-18 17:38:43 -07:00
zeekay b28f2b97d1 pulsarm → pulsar: drop the -M qualifier (suffix is redundant)
The "m" suffix originally stood for "Pulsar Module-LWE" to distinguish
it from the older Pulsar that was R-LWE (before Corona took over R-LWE
exclusively). With the rename complete — Corona owns Ring-LWE,
Pulsar owns Module-LWE — the suffix is dead naming overhead.

Renames:
  Directory:  ref/go/pkg/pulsarm/        → ref/go/pkg/pulsar/
  Package:    package pulsarm            → package pulsar
  Import:     .../ref/go/pkg/pulsarm     → .../ref/go/pkg/pulsar
  Type:       SigSchemePulsarM65 (etc.)  → SigSchemePulsar65
  Error tag:  "pulsarm: ..."             → "pulsar: ..."
  File:       pulsarm_test.go            → pulsar_test.go

38 files renamed in-place via git mv. Build + tests PASS (89 PASS
sub-tests, 0 FAIL; full pulsar suite in 0.473s).
2026-05-16 17:55:04 -07:00
zeekay 060903abd4 pulsarm: add parallel VerifyBatch — N-signature throughput for consensus
Single Verify is the only place this package touches FIPS 204
verification (Class N1 manifesto). VerifyBatch composes it across N
(groupPubkey, message, signature) tuples in parallel via a
GOMAXPROCS-bounded worker pool — no extra FIPS 204 surface.

Public surface added:
  - VerifyBatch(params, gpks, msgs, sigs) -> ([]error, error)
  - VerifyBatchCtx(params, gpks, msgs, ctx, sigs) -> ([]error, error)
  - VerifyBatchAll(params, gpks, msgs, sigs) -> (bool, error)
  - ErrBatchSizeMismatch

Pure Go: NO CGO / accel dep. The GPU fast-path
(accel.LatticeOps.DilithiumVerifyBatch) belongs at the engine layer
where the host's native libs are owned; this file is the portable
path everyone gets for free.

Tests (GOWORK=off go test ./pkg/pulsarm/ -run TestVerifyBatch):
  TestVerifyBatch_AllValid_MultiMode  (ModeP44, P65, P87 × n=8)  PASS
  TestVerifyBatch_OneCorrupt          (single sig byte-flip)     PASS
  TestVerifyBatch_StructuralMismatch  (slice len mismatch)       PASS
  TestVerifyBatch_Empty                                          PASS
Full suite: ok 0.409s.
2026-05-16 17:55:04 -07:00
zeekayandGitHub 4ca9811260 Merge pull request #1 from luxfi/licensing/canonical-pointer
docs: add LICENSING.md pointer to canonical Lux IP strategy
2026-05-15 16:43:37 -07:00
zeekay 9c04a52fee docs: add LICENSING.md pointing at canonical Lux IP strategy
Single LICENSING.md file referencing the canonical three-tier IP and
licensing strategy at github.com/luxfi/.github/blob/main/profile/README.md.

LICENSE file is unchanged; this only adds a navigational pointer.
2026-05-15 16:43:29 -07:00
zeekay d7dc75411e pulsar: drop -M qualifier everywhere — Pulsar (M-LWE) is the family name
Symmetric with Corona's parallel rename (PULSAR-* -> CORONA-* in
luxfi/corona). The -M was the M-LWE qualifier from when Pulsar-M and
Pulsar-R were sibling constructions; Pulsar-R shipped as Corona, so
the -M qualifier is dead weight across the family.

Changes:
  - spec/pulsar.tex: prose + tag strings PULSAR-M-* -> PULSAR-*
  - ref/go: all "Pulsar-M" string literals -> "Pulsar" in mode names,
    KAT message prefixes, and beacon strings (PULSAR-M-RESHARE-BEACON
    -> PULSAR-RESHARE-BEACON, etc.)
  - vectors/{sign,keygen,verify,threshold-sign,dkg}.json: regenerated
    from genkat with new mode strings

Preserved (different scope):
  - Go package directory name `pkg/pulsarm/` (renaming the dir is a
    Go module break for any importer; punted to a separate cleanup)
  - luxcpp/crypto/pulsar/ path references in comments (separate repo)

All 9 test packages pass: pulsarm (KAT replay, large e2e, reshare,
shamir, types) + the rest.
2026-05-13 14:21:45 -07:00
zeekay ea0d8cb32c pulsar: rename Pulsar-M -> Pulsar in prose, keep wire-format strings intact
The 'Pulsar-M' qualifier was meant to distinguish M-LWE Pulsar from a
planned R-LWE 'Pulsar-R'. R-LWE shipped as Corona instead, so the -M
qualifier is dead weight. The pq.tex profile table already says
'Pulsar-65 (was Pulsar-M-65)' — this aligns the spec.

What's preserved (wire format / crypto compat):
  - cSHAKE personalisation string 'Pulsar-M' on lines 459/600/720/733/867
  - All PULSAR-M-*-V1 domain-separation tags (DKG-COMMIT, SIGN-R1, etc.)

What changed (prose only):
  - Title, abstract, body references to the protocol
  - Filename pulsar-m.tex -> pulsar.tex
  - PDF pulsar-m.pdf -> pulsar.pdf

Pre-existing 'Paragraph ended before end' warning on line 76 is unchanged
and unrelated; PDF still builds (48 pages, 608 KB).
2026-05-13 13:40:52 -07:00
zeekay 1c2a9ee1af pulsar: add \GF macro, rename corona2024->boschini2024corona, bump Go to 1.26.3
- spec/pulsar-m.tex: define \newcommand{\GF}{\mathrm{GF}} so any later
    GF(q)/GF(2^k) usage doesn't trip an undefined control sequence.
  - spec/references.bib: rename the Corona bibtex key from corona2024
    to boschini2024corona — matches the catalogue-wide Corona->Corona
    rename (Corona is the production name).
  - go.mod: go directive 1.22.0 -> 1.26.3 (matches the rest of the stack).
2026-05-13 12:46:07 -07:00
zeekay a9ee92761a pulsar: kill all Corona mentions in spec, family-architecture, LLM.md
Spec citations now use \cite{boschini2024corona}. The family
architecture text describes Corona as Lux's production R-LWE library
(formerly the upstream that the academic R-LWE construction descends
from); the academic line is referenced by author + ePrint number only.

The historical academic R-LWE fork at luxfi/nasua remains unlinked
from this repo's docs per directive.
2026-05-12 10:07:49 -07:00
zeekayandGitHub 8eae404801 Update README.md 2026-05-12 09:21:09 -07:00
zeekay 44238c4738 README: drop hyperlink to nasua academic fork 2026-05-12 09:12:23 -07:00
zeekay 6b21b2da95 README: independent library + Double-Lattice composition with corona
Pulsar (Module-LWE) and Corona (Ring-LWE) are independently usable
threshold ML-DSA libraries — no shared types, no import line between
them. Each can be selected as a chain's sole PQ threshold layer.

Lux primary-network QuasarCert layers both as a Double-Lattice PQ
defence (Module + Ring), with optional BLS classical fast-path and
per-validator ML-DSA-65 rolled up via STARK/FRI through P3Q. Each
layer is checkable independently; a break in one lattice family does
not break finality.

The academic Corona upstream is referenced as luxfi/nasua (historical
reference fork, trusted-dealer DKG, not for public-chain use).
2026-05-12 09:08:46 -07:00
zeekay 3e2ed37580 BLOCKERS.md replaces known-limitations — red audit findings
13 production-go-live blockers from 4-red-agent + 1-scientist
adversarial audit (2026-05). The prior known-limitations framing
was too lenient; canonical bug list now at BLOCKERS.md.

The full per-finding spec (file:line refs, attack models, fix
sketches) lives at the submission mirror:
github.com/luxfi/pulsar-mptc/blob/main/BLOCKERS.md

This pulsar library remains shippable as research/reference (89.7%
coverage, Lean OutputInterchange+Unforgeability+Shamir zero-sorry,
KAT replay green). Production strict-PQ go-live is blocked on
closing CR-1 through CR-13.
2026-05-11 22:44:59 -07:00
zeekay d0d51198e2 pulsar: README — Module-LWE identity; v0.1.x R-LWE legacy retired
The legacy v0.1.0..v0.1.5 tags pointed at the prior Ring-LWE code line
and have been deleted from this repository to prevent
`go get github.com/luxfi/[email protected]` from silently pulling R-LWE
code under the new Module-LWE identity.

Ring-LWE code lives at github.com/luxfi/corona (inherits v0.1.x
history under its proper name). This repository is Module-LWE only,
starting at v1.0.0.
2026-05-11 19:36:58 -07:00
zeekay 6e93847ab2 pulsar: rename module path github.com/luxfi/pulsar-m → github.com/luxfi/pulsar
The Module-LWE threshold ML-DSA library claims its canonical name.
The legacy 'pulsar-m' suffix existed only because the Ring-LWE
library held the 'github.com/luxfi/pulsar' import path. That R-LWE
code has now moved to github.com/luxfi/corona; this library is the
sole Pulsar going forward.

NIST MPTC Class N1: byte-equal output to single-party FIPS 204
ML-DSA. Round-1 commit + Round-2 response + Combine produces a
signature that verifies under unmodified mldsa.Verify.

All tests pass under GOWORK=off.
2026-05-11 19:18:41 -07:00
zeekay ec32df305d pulsar/spec: family-architecture — Annulus is archived (was Nasua), production = Pulsar + Corona
Annulus is the academic-only, research-frozen root. The repo was
originally named Nasua and renamed to Annulus at the archive cut.
Production-enabled variants are Pulsar (M-LWE / FIPS 204) and
Corona (R-LWE production fork), both descending from Annulus.
2026-05-11 15:30:10 -07:00
zeekay 1b17935bc6 pulsar: simplify wire-format tags — drop redundant -M and LUXROUND
Hard fork of all customization tags. Per the family rename
(Pulsar-M → Pulsar), the -M suffix is now redundant. Per the
compound-word discipline, LUXROUND braids brand+concept and is
replaced by ROUND.

  PULSAR-M-DKG-COMMIT-V1       → PULSAR-DKG-COMMIT-V1
  PULSAR-M-DKG-TRANSCRIPT-V1   → PULSAR-DKG-TRANSCRIPT-V1
  PULSAR-M-DKG-DEALER-V1       → PULSAR-DKG-DEALER-V1
  PULSAR-M-DKG-BLINDMASK-V1    → PULSAR-DKG-BLINDMASK-V1
  PULSAR-M-COMMITTEE-V1        → PULSAR-COMMITTEE-V1
  PULSAR-M-SIGN-{R1,R2,...}-V1 → PULSAR-SIGN-{R1,R2,...}-V1
  PULSAR-M-RESHARE-*-V1        → PULSAR-RESHARE-*-V1
  PULSAR-M-EXPANDB-V1          → PULSAR-EXPANDB-V1
  PULSAR-M-COMPLAINT-V1        → PULSAR-COMPLAINT-V1
  PULSAR-M-SEED-SHARE-V1       → PULSAR-SEED-SHARE-V1
  PULSAR-M-LUXROUND-COMMITTEE-V1 → PULSAR-ROUND-COMMITTEE-V1
  cSHAKE function-name "Pulsar-M" → "Pulsar"

Every prior signature with -M tags is invalidated. KAT vectors
need regeneration. Test suite passes (85 tests, 0.530s).
2026-05-11 15:28:15 -07:00
zeekay 19ae5179d2 pulsar/spec: family-architecture — drop Annulus current usage, reserve for future 2026-05-11 15:16:01 -07:00
zeekay c4a19b71c0 pulsar/spec: enshrine Lux Quasar family in family-architecture.tex
Family table now lists three variants under the Lux Quasar family
umbrella:
  - Pulsar  (Module-LWE / FIPS 204, production-enabled)
  - Corona  (Ring-LWE, Lux production fork, production-enabled)
  - Annulus (Ring-LWE, academic root, code-name Nasua, not enabled)

Annulus is the academic-only research artifact tracking the
Corona upstream primitive (Boschini et al.) which itself builds
on the Raccoon FS-without-rejection template (del Pino et al.).
The implementation repo is github.com/luxfi/nasua.

Naming discipline now stellar/circular: Pulsar (rotating neutron
star), Corona (ring of light), Annulus (ring-shaped region). The
academic upstream's BLAKE3 hash profile is acknowledged but not
deployed; both Corona and Pulsar run on SHA-3 / SP 800-185.
2026-05-11 15:12:00 -07:00
zeekay 0df99b7364 pulsar: README — drop -M suffix (family rename) 2026-05-11 15:05:58 -07:00
zeekay 604a32a47d pulsar-m: drop unnecessary Lux prefix from round identifiers
LuxRoundContext / LuxRoundSessionID / LuxRoundCommitteeRoot /
LuxRoundSigShare / LuxRoundQuorumPolicy / DefaultLuxRoundQuorumPolicy
→ RoundContext / RoundSessionID / RoundCommitteeRoot / RoundSigShare /
RoundQuorumPolicy / DefaultRoundQuorumPolicy.

Files: luxround.go luxround_math.go luxround_test.go → round.go
round_test.go (math helpers folded into round.go). The protocol name
"Lux round" stays in prose / spec / paper titles -- only the Go
identifiers drop the brand prefix. The cSHAKE customization tag
PULSAR-M-LUXROUND-COMMITTEE-V1 is wire-format-stable and stays.
2026-05-11 13:42:08 -07:00
zeekay 52eea92a11 pulsar-m: convert NIST MPTC deliverables docs/*.md → spec/*.tex (CLAUDE.md LaTeX-only rule)
Per ~/.claude/CLAUDE.md ("papers/proofs/audits stay in LaTeX, never .md"
+ "NEVER write random summary files"), the six NIST MPTC submission
deliverables move from docs/ Markdown into spec/ LaTeX as
\input{...} chapters of pulsar-m.tex:

  docs/nist-mptc-category.md   -> spec/nist-mptc-category.tex
  docs/patent-notes-draft.md   -> spec/patent-notes.tex
  docs/threat-model.md         -> spec/threat-model.tex
  docs/known-limitations.md    -> spec/known-limitations.tex
  docs/family-architecture.md  -> spec/family-architecture.tex
  docs/design-decisions.md     -> spec/design-decisions.tex

Content preserved verbatim; only LaTeX-syntax stylistic edits.
pulsar-m.tex now \inputs each as its own section / appendix.
Go-source comments that referenced docs/* updated to spec/*.tex.
README + CONTRIBUTING refreshed.

GOWORK=off go test -count=1 ./... clean.
2026-05-11 12:31:43 -07:00
zeekay 38319c9fc8 pulsar-m: LLM.md — module-pin reconciliation plan (HIGH-4 prep) 2026-05-11 12:25:34 -07:00
zeekay 7e7d0d7cf2 pulsar-m: end-to-end test threshold Combine → FIPS 204 verify with precompile ctx (CRIT-2 closure)
CRIT-2: the Class N1 manifesto claim that a Pulsar threshold
Combine output verifies as a single-party FIPS 204 ML-DSA
signature under the EVM precompile ctx
(`lux-evm-precompile-pulsar-v1`) had no end-to-end test. Every
prior Combine call site passed ctx=nil, so the ctx-propagation
guarantee Combine -> mldsaSign -> circl SignTo was never
exercised against the production precompile string.

New test file precompile_e2e_test.go covers both Combine paths:

  - TestPrecompile_E2E_Combine_FIPS204_VerifyCtx exercises the
    GF(257) path at (T,N)=(3,2) for ModeP65.
  - TestPrecompile_E2E_LargeCombine_FIPS204_VerifyCtx exercises
    the GF(q) path at (T,N)=(3,2) for ModeP65.

Each test:
  1. Runs DKG to install a group public key.
  2. Drives ThresholdSigner / LargeThresholdSigner Round1+Round2
     on a message M.
  3. Calls Combine / LargeCombine with ctx=precompileCtx,
     randomized=false to produce the threshold signature.
  4. Asserts that BOTH
       (a) raw FIPS 204 cloudflare/circl mldsa65.Verify(pk, M,
           ctx=precompileCtx, sig), and
       (b) pulsarm.VerifyCtx(params, pk, M, ctx=precompileCtx,
           sig)
     accept the signature. This is the empirical Class N1
     closure for the precompile ctx.
  5. Negative control: the same signature must NOT verify under
     ctx=nil, proving ctx is actually load-bearing in the
     Combine output.

No ctx-propagation fix was required: threshold.go Combine and
large_threshold.go LargeCombine already forward ctx to
mldsaSign, which forwards to mldsa{44,65,87}.SignTo. The tests
verify this end-to-end.
2026-05-11 12:03:14 -07:00
zeekay 7acc764a4a pulsar-m: GF(q) Large* stack + luxround helpers + family rename docs
Adds the M-LWE large-committee track and metastable signing helpers,
plus the consolidated migration plan for the Pulsar/Corona/Corona/
Quasar rebrand:

- GF(q) byte-wise Shamir secret sharing (shamir_gfq.go) for committees
  beyond 256 parties, with q = 8,380,416 (ML-DSA q) and 128-byte wire
  share format.
- Large* protocol stack (large_types, large_dkg, large_threshold,
  large_reshare, largeshamir) targeting TargetCommitteeSize = 1,111,111
  with end-to-end tests at (3,2), (3,3), (5,3), (6,4).
- Wave-driven metastable signing helpers (luxround.go, luxround_math.go)
  with beta-round end-to-end coverage.
- Spec updates: parameters.tex, pulsar-m.tex, system-model.tex —
  large-committees section, security games, Lux-round composition.
- LLM.md: consolidates MIGRATION.md (deleted) into a single source of
  truth per CLAUDE.md repository rules. Family migration plan,
  destructive-action checklist, cleanliness audit.
- docs/family-architecture.md: scrub dated header.
- docs/known-limitations.md: track MPTC deadlines.

Tests: GOWORK=off go test -count=1 ./... is green.
2026-05-11 11:46:21 -07:00
zeekay fb4f37d989 pulsar-m: NIST MPTC submission readiness — benchmarks + CI gates
Final v0.1 polish:

  bench_test.go — reproducible benchmark harness covering KeyGen,
                   Sign, Verify across all three FIPS 204 parameter
                   sets, plus DKG, ThresholdSign, and Reshare at
                   representative committee sizes for ML-DSA-65.

The benchmark harness drives scripts/bench.sh; results land in
bench/results/{fingerprint.txt,go-bench.txt}. Apple M1 Max baseline
(Go 1.26.2, -benchtime=2s -count=3):

  KeyGen     P44  ~ 0.3 ms,  P65  ~ 0.5 ms,  P87  ~ 0.7 ms
  Sign       P44  ~ 1.6 ms,  P65  ~ 2.5 ms,  P87  ~ 3.0 ms
  Verify     P44  ~ 0.3 ms,  P65  ~ 0.5 ms,  P87  ~ 0.7 ms
  DKG        (5,3) ~ 3.5 ms,  (7,4) ~ 7 ms,   (10,7) ~ 12 ms
  Threshold  (5,3) ~ 2.2 ms,  (7,4) ~ 4.5 ms, (10,7) ~ 7 ms
  Reshare    (5→5,t=3) ~ 0.5 ms

The threshold path is dominated by FIPS 204 Sign latency for small
quorums; at (n=10, t=7) the 2-round overhead becomes comparable to
the FIPS 204 cost.

This commit closes the v0.1 reference impl gates:
  - scripts/build.sh   passes
  - scripts/test.sh    passes (61 tests, race-clean)
  - scripts/gen_vectors.sh passes; KATs deterministic
  - scripts/bench.sh   passes
  - Class N1 interchangeability demonstrated by every threshold KAT
    in vectors/threshold-sign.json passing under pulsarm.Verify
    (i.e. under unmodified mldsa{44,65,87}.Verify)

docs/known-limitations.md updated to reflect v0.1 reality: the
reconstruction-aggregator path ships in v0.1; the Lagrange-linearity
sign and R_q^k Pedersen are documented v0.2 paths.

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:26:56 -07:00
zeekay 1793dd64ac pulsar-m: KAT vectors for keygen / sign / verify / threshold / dkg
Canonical Known Answer Tests for the Pulsar-M v0.1 reference,
generated by ref/go/cmd/genkat. Re-running scripts/gen_vectors.sh on
a clean checkout reproduces these files byte-identically — the
deterministic-fixture gate.

Coverage:

  vectors/keygen.json        — 9 KATs (3 seeds × 3 modes)
                                 seed → (public_key, private_key)
  vectors/sign.json          — 9 KATs (3 messages × 3 modes)
                                 (seed, message) → signature
  vectors/verify.json        — 6 KATs (3 positive + 3 negative)
                                 (pubkey, message, signature, valid)
  vectors/threshold-sign.json — 4 KATs at (n,t) ∈ {(3,2),(5,3),
                                 (7,4),(10,7)} for Pulsar-M-65;
                                 every signature passes
                                 mldsa65.Verify (Class N1 demo)
  vectors/dkg.json           — 3 KATs at (3,2), (5,3), (7,4) for
                                 Pulsar-M-65; per-party shares and
                                 transcript hash committed

The replay harness in kat_test.go reads each JSON at test time and
verifies the round-trip:

  - Keygen replay: KeyFromSeed(seed) reproduces (pk, sk)
  - Sign replay:   Sign(deterministic) reproduces signature
  - Verify replay: pulsarm.Verify accepts every positive case and
                   rejects every negative case
  - Threshold:     every committed signature passes pulsarm.Verify
                   (which dispatches to FIPS 204 ML-DSA.Verify
                   verbatim — the load-bearing Class N1 property)
  - DKG:           wire-format invariants (sizes match parameter
                   set, transcript hash is 48 bytes, share count
                   matches committee count)

scripts/gen_vectors.sh + scripts/test.sh are now functional CI
gates.

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:26:37 -07:00
zeekay f8f0306d16 pulsar-m: proactive resharing with beacon-randomized quorum
HJKY97-style proactive resharing: rotate the share distribution from
an old committee to a new committee without changing the master
public key and without reconstructing the master secret in any
party's memory. Implements the spec/pulsar-m.tex §4.4 protocol with
the DD-006 mitigation (beacon-randomized quorum).

Three rounds, structurally similar to DKG except dealer contributions
have constant term λ_i^Q · share_i (pre-multiplied Lagrange
coefficient over the OLD quorum, computed in GF(257)). By Lagrange
linearity, the sum of dealer polynomials evaluated at X=0 IS the
master byte-sum — guaranteeing pk invariance (Theorem reshare-pkinv).

Beacon-randomized quorum selection: the old-committee quorum is the
first t_old members under the cSHAKE256(beacon || NodeID) permutation.
This blocks the mobile-adversary corruption-set positioning that
deterministic smallest-ID selection allows (HIP-0077 finding F10).

Tests:
  - SameCommittee_PubInvariant: a reshare with the same committee on
    both sides produces new shares that recover the SAME master
    public key via the canonical cSHAKE256 mix
  - NewCommittee: a one-member-rotation reshare produces shares for
    the new committee members
  - BeaconPermutation: different beacons produce different quorums;
    no-beacon falls back to canonical order
  - LagrangeAtZero: numerical correctness of the GF(257) Lagrange
    coefficients (sum to 1 mod p, individual values match algebra)
  - RejectInvalidCommittees: empty / threshold-too-large rejection

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:26:26 -07:00
zeekay 44b38e2496 pulsar-m: threshold sign (2-round commit + reveal)
Two-round threshold signing producing FIPS 204 ML-DSA signatures
byte-equal to what a single-party FIPS 204 signer would emit. This
is the Class N1 (signing) deliverable.

Protocol shape (v0.1 reconstruction-aggregator instantiation):

  Round 1 (party i): sample per-round mask r_i ← {0,1}^512.
    Compute masked share s'_i = share_i ⊕ r_i. Commit
    D_i = cSHAKE256(r_i || s'_i || tau_1)
    where tau_1 = (sid, kappa, T, i, pk, mu). Note: binding BOTH
    halves under D_i closes the masked-half-rotation gap a v0.1
    audit would otherwise expose.
    MAC D_i to every peer j ∈ T\{i} under the long-lived MAC key
    K_{i,j} via KMAC256 (PULSAR-M-SIGN-R1-MAC-V1). Broadcast
    (D_i, {MAC_{i,j}}).

  Round 2 (party i): verify every received MAC in constant time
    against the locally-known K_{i,j}. On MAC mismatch, emit
    ComplaintMACFailure. On success, reveal (r_i, s'_i) so peers
    can re-derive D_i and combine.

  Combine: aggregator gathers t Round-2 reveals, re-derives each
    D_i = cSHAKE256(mask || masked || tau_1) and checks it equals
    the Round-1 commit. Lagrange-interpolates the byte-sum at x=0
    in GF(257), reduces it via the same cSHAKE256 mix the DKG
    used, calls mldsa.SignTo on the recovered seed. Returns the
    FIPS 204 signature.

The resulting signature satisfies pulsarm.Verify (which is FIPS 204
ML-DSA.Verify verbatim). The v0.2 path replaces the
reconstruction-aggregator step with the Lagrange-linearity sign of
spec/pulsar-m.tex §4.2, where the master secret is never
reconstructed in any party's memory; output bytes are identical.

Tests (vs. n,t ∈ {(5,3),(7,4),(10,7)}):
  - RoundTrip: threshold-produced sig passes FIPS 204 Verify
  - BadMAC: tampered Round-1 MAC triggers ComplaintMACFailure
  - DifferentAttempt: kappa mismatch rejected at Round 2
  - TamperedReveal: any byte-flip in Round-2 reveal caught at
    Combine via commit-mismatch (both mask and masked are bound)
  - DifferentQuorum_SameMessage: two disjoint quorums both produce
    valid FIPS 204 sigs on the same message under the same pk
  - QuorumTooSmall: empty / non-member rejection

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:26:13 -07:00
zeekay 1685a8604b pulsar-m: epoch DKG with identifiable abort
Three-round Pedersen DKG over R_q with byte-wise Shamir share
distribution. Produces a FIPS 204-shaped group public key + a
per-party KeyShare; identifies the misbehaving party with a signed
AbortEvidence on detected deviation.

Protocol (matching spec/pulsar-m.tex §4.1):

  Round 1: each party samples a 32-byte contribution c_i, broadcasts
           an RO-binding cSHAKE256 commit C_i = cSHAKE256(c_i ||
           blind_i) under the PULSAR-M-DKG-COMMIT-V1 customisation
           tag, and Shamir-shares c_i byte-wise to the committee.

  Round 2: each party broadcasts the digest of the Round-1 messages
           it received from every dealer. The Round-1.5 equivocation
           gate: cross-recipient digest mismatch produces a signed
           ComplaintEquivocation with the offending party's NodeID.

  Round 3: each party verifies digest agreement (constant-time over
           48 bytes) and aggregates its share by summing per-byte
           envelope shares in GF(257). The master public key is
           derived by Lagrange-reconstructing the byte-sum from the
           first t committee positions and feeding the cSHAKE256-
           mixed result to FIPS 204 KeyFromSeed.

The output transcript hash is the 48-byte binding the chain pins to
the validator-set commitment. The KeyShare wire is parameter-set-
independent (64 bytes per share).

Identifiable abort (abort.go):
  ComplaintEquivocation — distinct commits to distinct recipients
  ComplaintBadDelivery  — envelope fails recipient-side check
  ComplaintMACFailure   — Round-1 / Round-2 MAC mismatch
  ComplaintRangeFailure — out-of-bounds aggregator contribution

The complaint wire format is forward-stable; new kinds append.

Tests:
  - HappyPath sweep (n,t) ∈ {(3,2),(5,3),(7,4),(10,7)} — every
    party arrives at the same group public key and the same
    transcript hash
  - Equivocation detection (tampered Round-2 digest produces a
    ComplaintEquivocation with the correct accused party)
  - ProducesValidPubkey_VerifiableSign: end-to-end demonstration
    that the DKG output recovers a FIPS 204-verifiable signing key
  - Committee duplicate / empty / non-member rejection
  - AbortEvidence wire-format round-trip, self-accusation rejection,
    transcript stability, and ComplaintKind string formatting

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:25:59 -07:00
zeekay 553b038e59 pulsar-m: byte-wise Shamir secret sharing over GF(257)
Foundation primitive for the threshold layer. Shamir-shares a
32-byte secret as 32 independent GF(257) instances, one per byte.
Each party's share is a 32 × uint16 wire blob (64 bytes total),
parameter-set-independent.

Why GF(257): 257 is the smallest prime > 255 so it admits every byte
value as a distinct field element. Per-byte sharing keeps the share
wire size minimal and audit-friendly. The DKG and Reshare layers
build directly on this; the cSHAKE256 final-mix step (in
DKG.reconstructByteSum and Combine) flattens any mod-256 vs. mod-257
byte-pattern bias before the resulting 32-byte seed is fed to FIPS
204 KeyFromSeed.

The GF(257) variant shamirDealRandomGF / shamirReconstructGF
preserves the 256-th element so HJKY97-style reshare can rotate
shares without changing the master public key.

Tests:
  - DealAndReconstruct (5 quorum sizes)
  - All-zero and all-0xff edge secrets
  - Duplicate / zero / out-of-range eval-point rejection
  - Bad threshold and oversize committee rejection
  - shareToBytes / shareFromBytes wire round-trip
  - modInvSmall correctness over the full GF(257) range
  - EvalPointFromID non-zero guarantee

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:25:42 -07:00
zeekay e082b5a9eb pulsar-m: keygen + sign + verify (single-party)
Wires single-party FIPS 204 ML-DSA through the canonical pulsarm
package surface. The Verify entry point is the Class N1 manifesto:
it dispatches to cloudflare/circl/sign/mldsa{44,65,87}.Verify
verbatim, so any FIPS-validated ML-DSA verifier consumes pulsarm
signatures with no code change.

Files:
  types.go        — PublicKey, PrivateKey, Signature, KeyShare,
                    Round{1,2}Message, DKG{Round1,Round2}Msg,
                    DKGOutput, AbortEvidence, ComplaintKind
  params.go       — Mode + Params for P44/P65/P87, ParamsFor +
                    Validate, all FIPS 204 §4 Table 1 numeric
                    constants pinned
  transcript.go   — FIPS 202 + SP 800-185 (cSHAKE256, KMAC256,
                    TupleHash-style transcript binding) with the
                    canonical PULSAR-M-* customisation tags
  keygen.go       — GenerateKey + KeyFromSeed; dispatches to circl
                    NewKeyFromSeed for FIPS 204-shaped output
  sign.go         — Sign over mldsa.SignTo; supports hedged and
                    deterministic variants
  verify.go       — Canonical Verify entry point; thin dispatch to
                    mldsa.Verify

Tests covering all three FIPS 204 parameter sets, deterministic
seed-based keygen reproducibility, signature-validation negatives
(tampered sig, wrong message, wrong pubkey, wrong mode, wrong size,
nil args), and SP 800-185 encoder NIST examples.

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:25:27 -07:00
zeekay 6fd38d451f pulsar-m: bootstrap NIST MPTC submission package
Initial commit. Holds the technical specification (LaTeX), the design
docs, the build/test/bench scripts, the package layout, and the empty
ref/go/pkg/pulsarm skeleton.

The spec at spec/pulsar-m.tex (11,300 words of LaTeX) is the canonical
description of the protocol. docs/nist-mptc-category.md states the
Class N1 + N4 claim. CONTRIBUTING.md and SECURITY.md pin the IP and
disclosure posture.

Subsequent commits land the reference implementation in stages.

Signed-off-by: Lux Industries <[email protected]>
2026-05-10 20:25:09 -07:00