Files
consensus/engine/pq/test_helpers_test.go
zeekay b4bb89df97 quasar: complete Ringtail purge — Corona (production R-LWE) + Nasua (academic upstream)
Followup to the QuasarCert field rename (commit 9b9bdda2). This sweeps
the remaining Ringtail identifiers and prose out of the consensus repo
entirely:

  - Identifiers (Go code):
    ringtailThreshold   → coronaThreshold      (import alias)
    ringtailGroupKey    → coronaGroupKey
    ringtailSigners     → coronaSigners
    ringtailShares      → coronaShares
    ringtailGobEncode   → coronaGobEncode
    ringtailGobDecode   → coronaGobDecode
    decodeRingtailSig   → decodeCoronaSig
    EncodeRingtailSig   → EncodeCoronaSig
    RingtailRound1{,Data,State} → CoronaRound1{,Data,State}
    RingtailGroupKey/Pub/Shares → Corona*

  - File rename:
    protocol/quasar/ringtail_gob.go → corona_gob.go

  - PQMode constants:
    PQModeRingtail            → PQModeNasua
    SigSchemeRingtailAcademic → SigSchemeNasua
    "ringtail" / "ringtail-academic" string forms → "nasua"

  - Prose & comments throughout the repo: "Ringtail" → "Corona" when
    naming the production Ring-LWE library, "Nasua" when naming the
    historical academic upstream (luxfi/nasua, formerly luxfi/ringtail).

Canonical Pulsar family taxonomy after this rename:

  Nasua  — academic R-LWE 2-round threshold sig (Boschini et al,
           ePrint 2024/1113); trusted-dealer DKG; kept as historical
           reference fork only. NOT for an open public chain.
  Corona — production Ring-LWE threshold ML-DSA (Pedersen DKG over R_q
           + proactive resharing); `github.com/luxfi/corona`. The
           Ring-LWE leg of QuasarCert.
  Pulsar — production Module-LWE threshold ML-DSA (FIPS 204
           byte-equal); `github.com/luxfi/pulsar`. The Module-LWE
           leg of QuasarCert. Pure-PQ pair = Corona + Pulsar.

Wire-format unchanged. Tests: 28/28 packages green (-short suite,
quasar 29s, integration 58s, no regressions).
2026-05-12 08:58:51 -07:00

44 lines
1.1 KiB
Go

// Copyright (C) 2025, Lux Industries Inc. All rights reserved.
package pq
import (
"testing"
"github.com/luxfi/consensus/protocol/quasar"
"github.com/luxfi/crypto/bls"
)
// newTestSigner returns a Quasar signer with a single configured validator
// covering BLS + Corona + ML-DSA. The first return is the validator ID
// chosen, the second is the signer ready for TripleSignRound1.
func newTestSigner(t *testing.T) (string, *quasar.Signer) {
t.Helper()
cfg, err := quasar.GenerateDualKeys(1, 3)
if err != nil {
t.Fatalf("GenerateDualKeys: %v", err)
}
s, err := quasar.NewSignerWithDualThreshold(*cfg)
if err != nil {
t.Fatalf("NewSignerWithDualThreshold: %v", err)
}
for _, id := range []string{"v0", "v1", "v2"} {
if err := s.AddValidator(id, 100); err != nil {
t.Fatalf("AddValidator(%s): %v", id, err)
}
}
return "v0", s
}
// testBLSAggKey returns a freshly generated BLS public key for tests that
// need any non-nil verify key to feed AttachVerifyKeys.
func testBLSAggKey(t *testing.T) *bls.PublicKey {
t.Helper()
sk, err := bls.NewSecretKey()
if err != nil {
t.Fatalf("bls.NewSecretKey: %v", err)
}
return sk.PublicKey()
}