Files
lattice/examples/example_test.go
T
zeekay eaf864890e feat: release v7.0.0 with GPU acceleration and module update
- Update module path to github.com/luxfi/lattice/v7
- Add GPU acceleration with Metal (macOS) and CUDA backends
- Enhance threshold FHE operations
- Revert to vanilla Apache 2.0 license (remove tfhe)
- Update Go version to 1.25.5
- Merge upstream lattigo improvements
2025-12-30 15:37:37 -08:00

47 lines
1.1 KiB
Go

package examples
import (
"testing"
"github.com/luxfi/lattice/v7/schemes/bgv"
"github.com/luxfi/lattice/v7/schemes/ckks"
)
func TestExampleParams(t *testing.T) {
for _, pl := range BGVParams {
p, err := bgv.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("BGVParams: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
for _, pl := range BGVScaleInvariantParams {
p, err := bgv.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("BGVScaleInvariantParams: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
for _, pl := range CKKSComplexParams {
p, err := ckks.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("CKKSComplex: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
for _, pl := range CKKSRealParams {
p, err := ckks.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("CKKSReal: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
}