Files
threshold/protocols/lss/factory_corona_prod.go
zeekay e5dbe95587 lss: gate research-preview Corona adapter behind -tags=researchpreview
Closes a HIGH-severity production-routing risk identified in the
pulsar/corona audit (2026-05-31).

The file protocols/lss/adapters/corona.go was a paper-grade
demonstrator that named itself "Corona" — colliding with the real
luxfi/corona Ring-LWE primitive. Anyone invoking the LSS factory with
`lss.NewLSS(lss.Corona, ...)` got the toy adapter, not the production
primitive. The toy adapter has:

 - A textbook-LWE "DKG" that sums each party's s_i into a combined
   master secret at the aggregator. NO Lagrange threshold sharing.
   The threshold parameter is decorative.

 - Q = 12289 (< 2^14) — far below any meaningful LWE security bound.

 - A Box-Muller-from-uniform-mod-Q Gaussian sampler using
   floating-point math on secret-dependent inputs. NOT constant-time.
   Side-channel leakage is GUARANTEED.

 - No matching verifier.

This commit:

  - adapters/corona.go     +build researchpreview
  - adapters/corona_test.go  +build researchpreview
  - adapters/corona_external_test.go  new gated external-test file
  - factory_corona_prod.go    new — production refuses with a routing
                              error pointing at
                              luxfi/threshold/protocols/corona →
                              luxfi/corona
  - factory_corona_research.go  new — research-preview returns the toy

Tests and benchmarks in adapters_test.go and full_coverage_test.go
that referenced NewCoronaAdapter / GetRecommendedParams have moved to
corona_external_test.go (gated). Production `go test ./protocols/lss/
adapters/...` passes; research `go test -tags researchpreview` also
passes.

Production users that need PQ threshold signing must route through
luxfi/threshold/protocols/corona (which wraps luxfi/corona): real
Ring-LWE with Pedersen-DKG, canonical wire codec (corona@42838bd), and
dudect-validated CT hot paths.

(cherry picked from commit eedafda56b8e277c483d9c96e67ba40a49052246)
2026-05-31 22:53:11 -07:00

39 lines
1.6 KiB
Go

// SPDX-License-Identifier: BSD-3-Clause
//go:build !researchpreview
// +build !researchpreview
package lss
import (
"errors"
"github.com/luxfi/threshold/protocols/lss/adapters"
)
// createCoronaAdapter is the production tag-split helper. It refuses to
// build a CoronaAdapter on the LSS path and points callers at the real
// post-quantum threshold primitive at luxfi/threshold/protocols/corona
// (which itself wraps luxfi/corona — Ring-LWE with Pedersen-DKG,
// canonical wire codec, dudect-validated CT hot paths).
//
// The LSS-side adapter (protocols/lss/adapters/corona.go) is paper-grade
// only: textbook-LWE additive "DKG" without Lagrange threshold sharing,
// Q=12289 (< 2^14), Box-Muller-from-uniform Gaussian sampler that is
// not constant-time. The naming collision with the real Corona primitive
// is what made this a Production Routing Risk — `lss.NewLSS(lss.Corona,
// ...)` would silently return the toy adapter on production builds.
//
// To use the research-preview LSS adapter for paper reproducibility,
// build with `-tags=researchpreview`.
func createCoronaAdapter() (adapters.SignerAdapter, error) {
return nil, errors.New(
"lss: production builds refuse to instantiate the LSS Corona adapter " +
"— route post-quantum threshold signing through " +
"luxfi/threshold/protocols/corona (which wraps the production " +
"luxfi/corona Ring-LWE primitive). The LSS-side adapter at " +
"protocols/lss/adapters/corona.go is research-preview only and " +
"lives behind -tags=researchpreview. See the file header for the " +
"trust-model disclosure.",
)
}