Files
zeekay 820d3c508d consensus: consume TALUS no-leak signer (pulsar v1.2.0 / threshold v1.10.2 / corona v0.8.0); rewire quasar Pulsar-leg tests to stock FIPS-204
pulsar v1.2.0 removes the small-committee threshold-signer surface
(NewThresholdSigner / ThresholdSigner / Round1Message / Round2Message /
Combine) in favour of the TALUS no-reconstruct BCC/CEF path. The Pulsar
leg of a Quasar cert verifies under the UNMODIFIED FIPS-204 verifier, so
a single-key signature under the group key is valid leg evidence — no
DKG, no ceremony is needed to GENERATE valid leg bytes for a
cert-composition test.

Replace signPulsarThresholdLeg (deleted threshold ceremony) with
signPulsarLegStock: GenerateKey + Sign via threshold/protocols/pulsar's
stock single-key path, returning the same *pulsar.Signature /
*pulsar.PublicKey alias types that ComposePolaris and
pulsarGroupPK.MarshalBinary already consume. The negative tests
(removed / tampered / missing-key Pulsar leg) still reject, so the leg
bytes remain load-bearing, not a stub.

Corona keygen (threshold/protocols/corona.GenerateKeys) is unchanged —
the trusted-dealer fixture name survives in the threshold corona adapter,
so no rename was needed in these consensus tests.

Production build unaffected (0 non-test refs to the removed APIs).
go test ./protocol/quasar/... ./protocol/auth/... ./config/... green;
go vet ./protocol/quasar/ clean.
2026-06-27 20:00:00 -07:00

48 lines
2.1 KiB
Go

// Copyright (C) 2025-2026, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package quasar
import (
"crypto/rand"
"testing"
"github.com/luxfi/threshold/protocols/pulsar"
)
// signPulsarLegStock produces a stock single-key FIPS-204 ML-DSA-65 signature
// over msg (empty ctx) and the matching group public key, via the threshold
// pulsar package's single-key path (GenerateKey + Sign).
//
// Why a single key is valid leg evidence: the Pulsar leg of a Quasar cert
// verifies under the UNMODIFIED FIPS-204 verifier (pulsarwire.VerifyBytes /
// pulsar.VerifyCtx, empty ctx). A signature under the group key therefore
// satisfies the leg predicate byte-for-byte — no DKG, no threshold ceremony is
// needed to GENERATE valid leg bytes for a cert-composition test. The
// no-reconstruct t-of-n threshold PRODUCER is gate-C, blocked on a Pulsar
// release that ships a poly-vector secret-share type (ML-DSA's s1 is non-linear
// in the GF(257) seed-share, so the current KeyShare admits only the
// reconstruct path); see the HONEST SCOPE note in consensus_cert_dualpq_test.go
// and luxfi/pulsar BLOCKERS.md PULSAR-V12-PARALLEL-PQ. The permissionless
// guarantee comes from the dealerless Corona leg in AND-mode, exactly as
// dualpq.go documents — this helper does NOT claim a Pulsar threshold ceremony.
//
// The returned *pulsar.Signature / *pulsar.PublicKey are the threshold pulsar
// wire types (aliases of the pulsar kernel types), so they feed ComposePolaris
// (legs.Pulsar.MarshalBinary) and pulsarGroupPK.MarshalBinary() unchanged, and
// verify through VerifyWithRealKeysPolaris' pulsarwire.VerifyBytes path.
func signPulsarLegStock(t *testing.T, params *pulsar.Params, msg []byte) (*pulsar.Signature, *pulsar.PublicKey) {
t.Helper()
sk, err := pulsar.GenerateKey(params, rand.Reader)
if err != nil {
t.Fatalf("pulsar.GenerateKey: %v", err)
}
// ctx=nil, randomized=false ⇒ deterministic, matching the empty-ctx FIPS-204
// verifier the cert's pulsar leg routes through.
sig, err := pulsar.Sign(params, sk, msg, nil, false, nil)
if err != nil {
t.Fatalf("pulsar.Sign: %v", err)
}
return sig, sk.Pub
}