Skip to content

Commit

Permalink
Move LibConfig into Generate directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeho committed Mar 16, 2024
1 parent 520cc61 commit 4e1def9
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/fhetest/Checker/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fhetest.Checker
import fhetest.Utils.*
import fhetest.Generate.T2Program
import fhetest.TEST_DIR
import fhetest.LibConfig
import fhetest.Generate.LibConfig

import io.circe._
import io.circe.generic.semiauto._
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/fhetest/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fhetest

import fhetest.Utils.*
import fhetest.Generate.Strategy
import Generate.LibConfig

class Config(
var fileName: Option[String] = None,
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/fhetest/Generate/AbsProgram.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package fhetest.Generate
import scala.util.Random
import fhetest.Generate.Utils.*
import fhetest.Utils.ENC_TYPE
import fhetest.LibConfig
import fhetest.Utils.*

case class AbsProgram(
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/fhetest/Generate/AbsProgramGenerator.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fhetest.Generate

import scala.util.Random
import fhetest.LibConfig
import fhetest.Utils.ENC_TYPE

// Template Generation Strategy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fhetest
package fhetest.Generate

import fhetest.Utils.*

Expand Down Expand Up @@ -94,7 +94,8 @@ Ciphertext<DCRTPoly> tmp_;"""
case SecurityLevel.HEStd_256_classic => "tc256"
}

lazy val moduliStr = s"vector<int> { $firstModSize$scaleModsStr, $firstModSize }"
lazy val moduliStr =
s"vector<int> { $firstModSize$scaleModsStr, $firstModSize }"
lazy val plainModStr =
if (scheme == Scheme.CKKS) ""
else s"parms.set_plain_modulus(${encParams.plainMod});"
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/fhetest/Generate/LibConfigGenerator.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package fhetest.Generate

import fhetest.LibConfig
import fhetest.Utils.*
import scala.util.Random

Expand Down Expand Up @@ -144,7 +143,6 @@ case class RandomLibConfigGenerator(encType: ENC_TYPE)
Some(Random.between(1, 100000 + 1))
val randomBoundOpt: Option[Int | Double] =
randomScheme match {
// #
case Scheme.BFV | Scheme.BGV =>
Some(Random.between(1, 1000 + 1))
case Scheme.CKKS => Some(Random.between(1, math.pow(2, 64) + 1))
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/fhetest/Generate/T2Program.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package fhetest.Generate

import fhetest.LibConfig

case class T2Program(content: String, libConfig: LibConfig)
2 changes: 1 addition & 1 deletion src/main/scala/fhetest/Generate/ValidFilter.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fhetest.Generate

import fhetest.LibConfig
// TODO: This must be removed because currently the Libconfig generation logic handle thees validations
import fhetest.Utils.*

def mulDepthIsSmall(realMulDepth: Int, configMulDepth: Int): Boolean =
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/fhetest/Phase/Check.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package fhetest.Phase

import fhetest.Checker.*
import fhetest.Generate.T2Program
import fhetest.LibConfig
import fhetest.Generate.LibConfig
import fhetest.Utils.*
import fhetest.Checker.DumpUtil

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/fhetest/Phase/Print.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.twc.terminator.t2dsl_compiler.T2DSLsyntaxtree.Goal;
import java.nio.file.{Files, Paths}

import java.io.*;
import fhetest.LibConfig
import fhetest.Generate.LibConfig

// TODO: Refactor optional arguments
case object Print {
Expand Down

0 comments on commit 4e1def9

Please sign in to comment.