mirror of
https://github.com/luxfi/pulsar.git
synced 2026-09-24 00:25:52 +00:00
Mirror of corona@42838bd. Magic PULS / PULG, version byte, bounded length-prefixed fields. VerifyBytes is stateless; wraps the FIPS 204 ML-DSA-44/65/87 verify (cloudflare/circl) over the unwrapped payload. The threshold-combined signature is byte-identical to a single-party FIPS 204 ML-DSA signature on the same message + group public key, verified by TestPulsar_Wire_FIPS204Verifiable across all three modes. Wire layout (big-endian): Signature: magic(4)='PULS' || version(2) || mode(1) || len(4) || FIPS-204-sig GroupKey: magic(4)='PULG' || version(2) || mode(1) || len(4) || FIPS-204-pk Bounded reads check declared length against the canonical FIPS 204 size for the declared mode BEFORE allocation, then against the remaining buffer — a malformed length header cannot trigger an oversized allocation. Trailing bytes after the frame are rejected. Distinct magic from corona's CORS/CORG defeats cross-protocol replay. orchestrate.go adds OrchestrateV03Sign — an in-process driver of the full Round1 / Round2W / Round2Sign / AlgebraicAggregate cycle with FIPS 204 rejection-restart, plus QuorumSessionKeys helper for the pairwise ML-KEM-768 + ML-DSA-65 identity layer. This is the surface luxfi/threshold/pkg/thresholdd consumes; lets the dispatcher publish a Signature in one call without leaking the package-private polyVec type out of pulsar. Tests: - TestPulsar_Wire_SigRoundtrip / GroupKeyRoundtrip across ModeP44/65/87 - TestPulsar_Wire_FIPS204Verifiable — frame round-trip then verify via cloudflare/circl directly with zero pulsar code on the verifier side. Headline cryptographic claim. - TestPulsar_Wire_RejectMalformed — empty, header-only, wrong-magic, group-key-magic-into-sig, wrong-version, unknown-mode, length- mismatch, length-oversized, trailing-bytes, truncated-payload. - TestPulsar_Wire_GroupKeyRejectMalformed — symmetric for GroupKey. - TestPulsar_Wire_VerifyBytes_RejectsCrossSlot — domain-separation between PULS and PULG is effective at the VerifyBytes surface. - TestPulsar_Wire_ModeMismatch_Rejected — gk.Mode != sig.Mode fails verify with no allocation surprise. - TestPulsar_Wire_MarshalSafetyChecks — nil receivers / unknown mode / wrong-length payloads refuse to emit malformed frames. Full pulsar/ref/go/pkg/pulsar test suite (87 tests, -race) green.