mirror of
https://github.com/luxfi/lattice.git
synced 2026-09-24 00:25:44 +00:00
fix: restore proper test skips for unsupported configurations
Restore t.Skip() calls that were incorrectly replaced with t.Logf(): - rlwe: Skip hoisted tests when BaseTwoDecomposition != 0 - rlwe: Skip GenSecretKey for non-ternary distributions - rlwe: Skip PartialTrace when #P = 0 - bgv/ckks: Skip level 0 tests (sync with upstream lattigo) These skips are necessary because certain operations are not supported for all parameter configurations by design.
This commit is contained in:
+9
-17
@@ -397,17 +397,13 @@ func testKeyGenerator(tc *TestContext, bpw2 int, t *testing.T) {
|
|||||||
// Checks that the secret-key has exactly params.h non-zero coefficients
|
// Checks that the secret-key has exactly params.h non-zero coefficients
|
||||||
t.Run(testString(params, params.MaxLevelQ(), params.MaxLevelP(), bpw2, "KeyGenerator/GenSecretKey"), func(t *testing.T) {
|
t.Run(testString(params, params.MaxLevelQ(), params.MaxLevelP(), bpw2, "KeyGenerator/GenSecretKey"), func(t *testing.T) {
|
||||||
|
|
||||||
// Test all distribution types - removed skips
|
|
||||||
var skipProb bool
|
|
||||||
switch xs := params.Xs().(type) {
|
switch xs := params.Xs().(type) {
|
||||||
case ring.Ternary:
|
case ring.Ternary:
|
||||||
skipProb = xs.P != 0
|
if xs.P != 0 {
|
||||||
|
t.Skip("cannot run test for probabilistic ternary distribution")
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
skipProb = true
|
t.Skip("cannot run test for non ternary distribution")
|
||||||
}
|
|
||||||
if skipProb {
|
|
||||||
// For non-ternary distributions, use a simplified test
|
|
||||||
t.Logf("Running simplified test for non-ternary distribution")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
skINTT := NewSecretKey(params)
|
skINTT := NewSecretKey(params)
|
||||||
@@ -736,13 +732,9 @@ func testGadgetProduct(tc *TestContext, levelQ, bpw2 int, t *testing.T) {
|
|||||||
buffDecompQP := poolQP.GetBuffDecompQP(params, levelQ, levelP)
|
buffDecompQP := poolQP.GetBuffDecompQP(params, levelQ, levelP)
|
||||||
defer poolQP.RecycleBuffDecompQP(buffDecompQP)
|
defer poolQP.RecycleBuffDecompQP(buffDecompQP)
|
||||||
|
|
||||||
// Test all parameter configurations - removed skips
|
// Hoisting is not supported with bit decomposition
|
||||||
if bpw2 != 0 {
|
if bpw2 != 0 {
|
||||||
t.Logf("Running modified test for BaseTwoDecomposition != 0")
|
t.Skip("method is unsupported for BaseTwoDecomposition != 0")
|
||||||
}
|
|
||||||
|
|
||||||
if tc.params.MaxLevelP() == -1 {
|
|
||||||
t.Logf("Running simplified test for #P = 0 case")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
skOut := kgen.GenSecretKeyNew()
|
skOut := kgen.GenSecretKeyNew()
|
||||||
@@ -962,7 +954,7 @@ func testAutomorphism(tc *TestContext, level, bpw2 int, t *testing.T) {
|
|||||||
t.Run(testString(params, level, params.MaxLevelP(), bpw2, "Evaluator/AutomorphismHoisted"), func(t *testing.T) {
|
t.Run(testString(params, level, params.MaxLevelP(), bpw2, "Evaluator/AutomorphismHoisted"), func(t *testing.T) {
|
||||||
|
|
||||||
if bpw2 != 0 {
|
if bpw2 != 0 {
|
||||||
t.Logf("Running modified test for BaseTwoDecomposition != 0")
|
t.Skip("method is unsupported for BaseTwoDecomposition != 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup temporary buffer for decomposition
|
// Setup temporary buffer for decomposition
|
||||||
@@ -1017,7 +1009,7 @@ func testAutomorphism(tc *TestContext, level, bpw2 int, t *testing.T) {
|
|||||||
t.Run(testString(params, level, params.MaxLevelP(), bpw2, "Evaluator/AutomorphismHoistedLazy"), func(t *testing.T) {
|
t.Run(testString(params, level, params.MaxLevelP(), bpw2, "Evaluator/AutomorphismHoistedLazy"), func(t *testing.T) {
|
||||||
|
|
||||||
if bpw2 != 0 {
|
if bpw2 != 0 {
|
||||||
t.Logf("Running modified test for BaseTwoDecomposition != 0")
|
t.Skip("method is unsupported for BaseTwoDecomposition != 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup temporary buffer for decomposition
|
// Setup temporary buffer for decomposition
|
||||||
@@ -1086,7 +1078,7 @@ func testSlotOperations(tc *TestContext, level, bpw2 int, t *testing.T) {
|
|||||||
t.Run(testString(params, level, params.MaxLevelP(), bpw2, "Evaluator/PartialTrace"), func(t *testing.T) {
|
t.Run(testString(params, level, params.MaxLevelP(), bpw2, "Evaluator/PartialTrace"), func(t *testing.T) {
|
||||||
|
|
||||||
if params.MaxLevelP() == -1 {
|
if params.MaxLevelP() == -1 {
|
||||||
t.Logf("Running simplified test for #P = 0 case")
|
t.Skip("test requires #P > 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
batch := 5
|
batch := 5
|
||||||
|
|||||||
+48
-22
@@ -430,7 +430,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/Mul/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/Mul/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
||||||
@@ -451,7 +453,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/Mul/Ct/Pt/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/Mul/Ct/Pt/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
values1, plaintext, _ := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
values1, plaintext, _ := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
||||||
@@ -472,7 +476,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/Mul/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/Mul/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
|
|
||||||
@@ -492,7 +498,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Evaluator/Mul/Ct/Vector/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/Mul/Ct/Vector/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
|
|
||||||
@@ -509,7 +517,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/Square/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/Square/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
|
|
||||||
@@ -526,7 +536,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/MulRelin/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/MulRelin/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
||||||
@@ -551,7 +563,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/MulThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/MulThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(2), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(2), true)
|
||||||
@@ -575,7 +589,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/MulThenAdd/Ct/Pt/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/MulThenAdd/Ct/Pt/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
values1, plaintext1, _ := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(2), true)
|
values1, plaintext1, _ := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(2), true)
|
||||||
@@ -599,7 +615,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/MulThenAdd/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/MulThenAdd/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
||||||
@@ -622,7 +640,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/MulThenAdd/Ct/Vector/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/MulThenAdd/Ct/Vector/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
||||||
@@ -648,7 +668,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/MulRelinThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/MulRelinThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(2), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(2), true)
|
||||||
@@ -757,7 +779,9 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Evaluator/InnerSum/", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/InnerSum/", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
n := tc.Params.MaxSlots() >> (i + offset)
|
n := tc.Params.MaxSlots() >> (i + offset)
|
||||||
batchSize := 1 << i
|
batchSize := 1 << i
|
||||||
|
|
||||||
@@ -792,7 +816,7 @@ func testEvaluatorBvg(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Evaluator/RotateAndAdd/", tc, lvl), func(t *testing.T) {
|
t.Run(name("Evaluator/RotateAndAdd/", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Skipping: Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
galEls := tc.Params.GaloisElementsForInnerSum(batchSize, n)
|
galEls := tc.Params.GaloisElementsForInnerSum(batchSize, n)
|
||||||
@@ -826,7 +850,9 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
lvl := lvl
|
lvl := lvl
|
||||||
t.Run(name("Mul/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Mul/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all levels including Level 0 - removed skip
|
if lvl == 0 {
|
||||||
|
t.Skip("Skipping: Level = 0")
|
||||||
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
values1, _, ciphertext1 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(7), true)
|
||||||
@@ -848,7 +874,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Mul/Ct/Pt/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Mul/Ct/Pt/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values0, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
@@ -871,7 +897,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Mul/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Mul/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
@@ -892,7 +918,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Square/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("Square/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values, _, ciphertext := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
@@ -911,7 +937,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("MulRelin/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("MulRelin/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
@@ -938,7 +964,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("MulThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("MulThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
@@ -965,7 +991,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
@@ -991,7 +1017,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("MulThenAdd/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("MulThenAdd/Ct/Scalar/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.NewScale(3), true)
|
||||||
@@ -1016,7 +1042,7 @@ func testEvaluatorBfv(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("MulRelinThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
t.Run(name("MulRelinThenAdd/Ct/Ct/Inplace", tc, lvl), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if lvl == 0 {
|
if lvl == 0 {
|
||||||
// Test all levels including Level 0 - removed skip
|
t.Skip("Level = 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
values0, _, ciphertext0 := NewTestVector(tc.Params, tc.Ecd, tc.Enc, lvl, tc.Params.DefaultScale(), true)
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ func TestCKKS(t *testing.T) {
|
|||||||
|
|
||||||
paramsLiteral.RingType = ringType
|
paramsLiteral.RingType = ringType
|
||||||
|
|
||||||
// paramsLiteral.LogN = 10
|
if testing.Short() {
|
||||||
|
paramsLiteral.LogN = 10
|
||||||
|
}
|
||||||
|
|
||||||
tc := NewTestContext(paramsLiteral)
|
tc := NewTestContext(paramsLiteral)
|
||||||
|
|
||||||
@@ -178,7 +180,9 @@ func testEncoder(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Encoder/IsBatched=true/DecodePublic/[]complex128", tc), func(t *testing.T) {
|
t.Run(name("Encoder/IsBatched=true/DecodePublic/[]complex128", tc), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
// Test all ring types - removed skip for ConjugateInvariant
|
if tc.Params.RingType() == ring.ConjugateInvariant {
|
||||||
|
t.Skip()
|
||||||
|
}
|
||||||
values, plaintext, _ := tc.NewTestVector(-1-1i, 1+1i)
|
values, plaintext, _ := tc.NewTestVector(-1-1i, 1+1i)
|
||||||
|
|
||||||
have := make([]complex128, len(values))
|
have := make([]complex128, len(values))
|
||||||
@@ -217,7 +221,9 @@ func testEncoder(tc *TestContext, t *testing.T) {
|
|||||||
|
|
||||||
t.Run(name("Encoder/IsBatched=true/DecodePublic/[]bignum.Complex", tc), func(t *testing.T) {
|
t.Run(name("Encoder/IsBatched=true/DecodePublic/[]bignum.Complex", tc), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// Test all ring types - removed skip for ConjugateInvariant
|
if tc.Params.RingType() == ring.ConjugateInvariant {
|
||||||
|
t.Skip()
|
||||||
|
}
|
||||||
values, plaintext, _ := tc.NewTestVector(-1-1i, 1+1i)
|
values, plaintext, _ := tc.NewTestVector(-1-1i, 1+1i)
|
||||||
have := make([]*bignum.Complex, len(values))
|
have := make([]*bignum.Complex, len(values))
|
||||||
require.NoError(t, tc.Ecd.DecodePublic(plaintext, have, logprec))
|
require.NoError(t, tc.Ecd.DecodePublic(plaintext, have, logprec))
|
||||||
@@ -467,7 +473,7 @@ func testEvaluatorRescale(tc *TestContext, t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
if tc.Params.MaxLevel() < 2 {
|
if tc.Params.MaxLevel() < 2 {
|
||||||
t.Logf("Running modified test for params max level < 2")
|
t.Skip("skipping test for params max level < 2")
|
||||||
}
|
}
|
||||||
|
|
||||||
values, _, ciphertext := tc.NewTestVector(-1-1i, 1+1i)
|
values, _, ciphertext := tc.NewTestVector(-1-1i, 1+1i)
|
||||||
@@ -489,7 +495,7 @@ func testEvaluatorRescale(tc *TestContext, t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
if tc.Params.MaxLevel() < 2 {
|
if tc.Params.MaxLevel() < 2 {
|
||||||
t.Logf("Running modified test for params max level < 2")
|
t.Skip("skipping test for params max level < 2")
|
||||||
}
|
}
|
||||||
|
|
||||||
values, _, ciphertext := tc.NewTestVector(-1-1i, 1+1i)
|
values, _, ciphertext := tc.NewTestVector(-1-1i, 1+1i)
|
||||||
@@ -771,7 +777,9 @@ func testBridge(tc *TestContext, t *testing.T) {
|
|||||||
t.Run(name("Bridge", tc), func(t *testing.T) {
|
t.Run(name("Bridge", tc), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
// Test all ring types - removed skip restriction
|
if tc.Params.RingType() != ring.ConjugateInvariant {
|
||||||
|
t.Skip("only tested for params.RingType() == ring.ConjugateInvariant")
|
||||||
|
}
|
||||||
|
|
||||||
ciParams := tc.Params
|
ciParams := tc.Params
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
Reference in New Issue
Block a user