From f764ea5cf5c3bba742e975837aa69e4d24752b9e Mon Sep 17 00:00:00 2001 From: nindanaoto Date: Tue, 20 Feb 2024 16:06:50 +0000 Subject: [PATCH] Added lvl0test --- test/gate.cpp | 92 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/test/gate.cpp b/test/gate.cpp index 3e2f123..794fd1f 100644 --- a/test/gate.cpp +++ b/test/gate.cpp @@ -144,39 +144,73 @@ void RunTest() vector> cres(kNumTests); vector> c(3 * kNumTests); - Test

("NOT", TFHEpp::HomNOT

, NotChegk, p, cres, c, kNumTests, *sk, ek); - Test

("COPY", TFHEpp::HomCOPY

, CopyChegk, p, cres, c, kNumTests, *sk, - ek); - Test

("NAND", TFHEpp::HomNAND, - NandChegk, p, cres, c, kNumTests, *sk, ek); - Test

("OR", TFHEpp::HomOR, OrChegk, - p, cres, c, kNumTests, *sk, ek); - Test

("ORYN", TFHEpp::HomORYN, - OrYNChegk, p, cres, c, kNumTests, *sk, ek); - Test

("ORNY", TFHEpp::HomORNY, - OrNYChegk, p, cres, c, kNumTests, *sk, ek); - Test

("AND", TFHEpp::HomAND, - AndChegk, p, cres, c, kNumTests, *sk, ek); - Test

("ANDYN", TFHEpp::HomANDYN, - AndYNChegk, p, cres, c, kNumTests, *sk, ek); - Test

("ANDNY", TFHEpp::HomANDNY, - AndNYChegk, p, cres, c, kNumTests, *sk, ek); - Test

("XOR", TFHEpp::HomXOR, - XorChegk, p, cres, c, kNumTests, *sk, ek); - Test

("XNOR", TFHEpp::HomXNOR, - XnorChegk, p, cres, c, kNumTests, *sk, ek); - Test

("MUX", TFHEpp::HomMUX

, MuxChegk, p, cres, c, kNumTests, *sk, ek); - Test

("NMUX", TFHEpp::HomNMUX

, NMuxChegk, p, cres, c, kNumTests, *sk, - ek); - Test

("ConstantZero", TFHEpp::HomCONSTANTZERO

, ConstantZeroChegk, p, - cres, c, kNumTests, *sk, ek); - Test

("ConstantOne", TFHEpp::HomCONSTANTONE

, ConstantOneChegk, p, cres, - c, kNumTests, *sk, ek); + if constexpr (std::is_same_v) { + cout << "lvl0param" << endl; + Test

("NOT", TFHEpp::HomNOT

, NotChegk, p, cres, c, kNumTests, *sk, ek); + Test

("COPY", TFHEpp::HomCOPY

, CopyChegk, p, cres, c, kNumTests, *sk, + ek); + Test

("NAND", TFHEpp::HomNAND, + NandChegk, p, cres, c, kNumTests, *sk, ek); + Test

("OR", TFHEpp::HomOR, OrChegk, + p, cres, c, kNumTests, *sk, ek); + Test

("ORYN", TFHEpp::HomORYN, + OrYNChegk, p, cres, c, kNumTests, *sk, ek); + Test

("ORNY", TFHEpp::HomORNY, + OrNYChegk, p, cres, c, kNumTests, *sk, ek); + Test

("AND", TFHEpp::HomAND, + AndChegk, p, cres, c, kNumTests, *sk, ek); + Test

("ANDYN", TFHEpp::HomANDYN, + AndYNChegk, p, cres, c, kNumTests, *sk, ek); + Test

("ANDNY", TFHEpp::HomANDNY, + AndNYChegk, p, cres, c, kNumTests, *sk, ek); + Test

("XOR", TFHEpp::HomXOR, + XorChegk, p, cres, c, kNumTests, *sk, ek); + Test

("XNOR", TFHEpp::HomXNOR, + XnorChegk, p, cres, c, kNumTests, *sk, ek); + Test

("MUX", TFHEpp::HomMUX

, MuxChegk, p, cres, c, kNumTests, *sk, ek); + Test

("NMUX", TFHEpp::HomNMUX

, NMuxChegk, p, cres, c, kNumTests, *sk, + ek); + Test

("ConstantZero", TFHEpp::HomCONSTANTZERO

, ConstantZeroChegk, p, + cres, c, kNumTests, *sk, ek); + Test

("ConstantOne", TFHEpp::HomCONSTANTONE

, ConstantOneChegk, p, cres, + c, kNumTests, *sk, ek); + } + else if constexpr (std::is_same_v) { + cout << "lvl1param" << endl; + Test

("NOT", TFHEpp::HomNOT

, NotChegk, p, cres, c, kNumTests, *sk, ek); + Test

("COPY", TFHEpp::HomCOPY

, CopyChegk, p, cres, c, kNumTests, *sk, + ek); + Test

("NAND", TFHEpp::HomNAND, + NandChegk, p, cres, c, kNumTests, *sk, ek); + Test

("OR", TFHEpp::HomOR, OrChegk, + p, cres, c, kNumTests, *sk, ek); + Test

("ORYN", TFHEpp::HomORYN, + OrYNChegk, p, cres, c, kNumTests, *sk, ek); + Test

("ORNY", TFHEpp::HomORNY, + OrNYChegk, p, cres, c, kNumTests, *sk, ek); + Test

("AND", TFHEpp::HomAND, + AndChegk, p, cres, c, kNumTests, *sk, ek); + Test

("ANDYN", TFHEpp::HomANDYN, + AndYNChegk, p, cres, c, kNumTests, *sk, ek); + Test

("ANDNY", TFHEpp::HomANDNY, + AndNYChegk, p, cres, c, kNumTests, *sk, ek); + Test

("XOR", TFHEpp::HomXOR, + XorChegk, p, cres, c, kNumTests, *sk, ek); + Test

("XNOR", TFHEpp::HomXNOR, + XnorChegk, p, cres, c, kNumTests, *sk, ek); + Test

("MUX", TFHEpp::HomMUX

, MuxChegk, p, cres, c, kNumTests, *sk, ek); + Test

("NMUX", TFHEpp::HomNMUX

, NMuxChegk, p, cres, c, kNumTests, *sk, + ek); + Test

("ConstantZero", TFHEpp::HomCONSTANTZERO

, ConstantZeroChegk, p, + cres, c, kNumTests, *sk, ek); + Test

("ConstantOne", TFHEpp::HomCONSTANTONE

, ConstantOneChegk, p, cres, + c, kNumTests, *sk, ek); + } } int main() { RunTest(); - // RunTest(); + RunTest(); return 0; } \ No newline at end of file