mirror of
https://github.com/luxfi/lattice.git
synced 2026-09-24 00:25:44 +00:00
fix: resolve staticcheck warnings
- Remove empty if branches in ring_packing_test.go (SA9003) - Remove unused ringP field in dag/executor.go (U1000) - Lowercase error strings in dag/executor.go (ST1005)
This commit is contained in:
@@ -319,9 +319,7 @@ func testRingPacking(tc *TestContext, t *testing.T) {
|
||||
|
||||
t.Run(testString(params, params.MaxLevelQ(), params.MaxLevelP(), 0, "Repack"), func(t *testing.T) {
|
||||
|
||||
if params.RingType() != ring.Standard {
|
||||
// Test all ring types - removed skip for ConjugateInvariant
|
||||
}
|
||||
// Note: Test runs for all ring types including ConjugateInvariant
|
||||
t.Parallel()
|
||||
|
||||
pt := NewPlaintext(params, level)
|
||||
@@ -392,9 +390,7 @@ func testRingPacking(tc *TestContext, t *testing.T) {
|
||||
}
|
||||
|
||||
func testExtractPermuteRepack(params Parameters, level int, enc *Encryptor, dec *Decryptor, eval *RingPackingEvaluator, ExtractNaive, RepackNaive bool, t *testing.T) {
|
||||
if params.RingType() != ring.Standard {
|
||||
// Test all ring types - removed skip for ConjugateInvariant
|
||||
}
|
||||
// Note: Test runs for all ring types including ConjugateInvariant
|
||||
|
||||
ringQ := params.RingQ().AtLevel(level)
|
||||
|
||||
|
||||
+4
-5
@@ -89,9 +89,8 @@ type ExecutionContext struct {
|
||||
gpuCtx any // Will be *gpu.NTTContext when GPU is available
|
||||
|
||||
// Ring parameters
|
||||
ringQ *ring.Ring
|
||||
ringP *ring.Ring // May be nil
|
||||
degree int
|
||||
ringQ *ring.Ring
|
||||
degree int
|
||||
maxLevel int
|
||||
|
||||
// Statistics
|
||||
@@ -260,7 +259,7 @@ func (e *Executor) registerDefaultOps() {
|
||||
// Negate operation
|
||||
e.ops[OpNegate] = func(ctx *ExecutionContext, node *Node, level int) error {
|
||||
if len(node.Inputs) != 1 {
|
||||
return fmt.Errorf("Negate requires 1 input, got %d", len(node.Inputs))
|
||||
return fmt.Errorf("negate requires 1 input, got %d", len(node.Inputs))
|
||||
}
|
||||
|
||||
in, ok := ctx.GetCiphertext(CiphertextID(node.Inputs[0]))
|
||||
@@ -329,7 +328,7 @@ func (e *Executor) registerDefaultOps() {
|
||||
// Copy operation
|
||||
e.ops[OpCopy] = func(ctx *ExecutionContext, node *Node, level int) error {
|
||||
if len(node.Inputs) != 1 {
|
||||
return fmt.Errorf("Copy requires 1 input, got %d", len(node.Inputs))
|
||||
return fmt.Errorf("copy requires 1 input, got %d", len(node.Inputs))
|
||||
}
|
||||
|
||||
in, ok := ctx.GetCiphertext(CiphertextID(node.Inputs[0]))
|
||||
|
||||
Reference in New Issue
Block a user