Files
threshold/protocols/tfhe/unsafe_env_test.go
zeekay 678ec5048a protocols/tfhe: rename unsafe_test_helper_test.go → unsafe_env_test.go
File holds exactly one thing — a TestMain that sets
ALLOW_FAKE_TFHE_FOR_TESTING_ONLY=1 for the duration of the test
binary. "test_helper" said nothing about that; the file's value is
"env-var setup for the unsafe-TFHE test guard."
2026-06-01 00:27:21 -07:00

26 lines
842 B
Go

// Copyright (c) 2024-2026 Lux Industries Inc.
// SPDX-License-Identifier: BSD-3-Clause
package tfhe
import (
"os"
"testing"
)
// TestMain opts the existing fake-threshold tests into the UNSAFE
// implementation by setting ALLOW_FAKE_TFHE_FOR_TESTING_ONLY=1 for
// the duration of the test binary. Production paths are guarded by
// guardUnsafe() and panic when this env var is unset.
//
// The fake-threshold implementation is documented in tfhe.go and
// lps/LP-137-TFHE-REAL-THRESHOLD-SPEC.md. These tests verify the
// orchestration shape only — they do NOT verify any threshold security
// property because the underlying scheme has none.
func TestMain(m *testing.M) {
if err := os.Setenv(unsafeTFHEEnvVar, "1"); err != nil {
panic("tfhe test setup: cannot set " + unsafeTFHEEnvVar + ": " + err.Error())
}
os.Exit(m.Run())
}