diff --git a/psi/algorithm/spiral/spiral_pir_test.cc b/psi/algorithm/spiral/spiral_pir_test.cc index 4ff61ad..edf0a44 100644 --- a/psi/algorithm/spiral/spiral_pir_test.cc +++ b/psi/algorithm/spiral/spiral_pir_test.cc @@ -75,7 +75,7 @@ TEST_P(SpiralPirTest, Works) { SPDLOG_INFO("GenRandomDatabase, time cost: {} ms", timer.CountMs()); // get a SpiralParams - auto spiral_params = util::GetPerformanceImproveParam(); + auto spiral_params = util::GetDefaultParam(); spiral_params.UpdateByDatabaseInfo(database_info); SPDLOG_INFO("MaxByteLenofPt: {}, MaxBitLenOfPt: {}", @@ -173,4 +173,4 @@ INSTANTIATE_TEST_SUITE_P(Works_Instances, SpiralPirTest, TestParams{10000, 8193, true}, TestParams{1000, 8192 * 10, true})); -} // namespace psi::spiral \ No newline at end of file +} // namespace psi::spiral diff --git a/psi/algorithm/spiral/util.cc b/psi/algorithm/spiral/util.cc index a74bff6..49c590a 100644 --- a/psi/algorithm/spiral/util.cc +++ b/psi/algorithm/spiral/util.cc @@ -56,6 +56,19 @@ Params GetPerformanceImproveParam() { std::move(poly_matrix_params), std::move(query_params)); } +Params GetDefaultParam() { + std::size_t poly_len{2048}; + std::vector moduli{268369921, 249561089}; + + double noise_width{6.4}; + + PolyMatrixParams poly_matrix_params(2, 256, 21, 4, 8, 8, 6); + QueryParams query_params(9, 6, 1); + + return Params(poly_len, std::move(moduli), noise_width, + std::move(poly_matrix_params), std::move(query_params)); +} + Params GetFastExpansionTestingParam() { std::size_t poly_len{2048}; std::vector moduli{268369921, 249561089}; diff --git a/psi/algorithm/spiral/util.h b/psi/algorithm/spiral/util.h index 2213cd0..34583dc 100644 --- a/psi/algorithm/spiral/util.h +++ b/psi/algorithm/spiral/util.h @@ -25,8 +25,11 @@ Params GetFastExpansionTestingParam(); Params GetTestParam(); +// this params has the best performance, but has smallest noise budget Params GetPerformanceImproveParam(); +Params GetDefaultParam(); + Params GetLargerParam(); // calc multi-dimension position in 1-deimension's position