From 65f46185d0b6e160b4399a29805934f0239d578a Mon Sep 17 00:00:00 2001 From: yspolyakov <89226542+yspolyakov@users.noreply.github.com> Date: Wed, 12 Jun 2024 22:57:56 -0400 Subject: [PATCH 1/4] Update bindings.cpp --- src/lib/bindings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/bindings.cpp b/src/lib/bindings.cpp index 455d87d..2389884 100644 --- a/src/lib/bindings.cpp +++ b/src/lib/bindings.cpp @@ -1063,6 +1063,7 @@ void bind_encodings(py::module &m) .def("SetFormat", &PlaintextImpl::SetFormat, ptx_SetFormat_docs, py::arg("fmt")) + .def("GetCoefPackedValue", &PlaintextImpl::GetCoefPackedValue) .def("GetPackedValue", &PlaintextImpl::GetPackedValue) .def("GetCKKSPackedValue", &PlaintextImpl::GetCKKSPackedValue, ptx_GetCKKSPackedValue_docs) From 6e82c4b212f44f5f8396110fe8d8e0dd7cf4e993 Mon Sep 17 00:00:00 2001 From: Yuriy Polyakov Date: Mon, 24 Jun 2024 23:18:23 -0400 Subject: [PATCH 2/4] fixes for v1.2.0 --- src/lib/bindings.cpp | 8 +++----- src/lib/binfhe_bindings.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib/bindings.cpp b/src/lib/bindings.cpp index 2389884..639ba48 100644 --- a/src/lib/bindings.cpp +++ b/src/lib/bindings.cpp @@ -56,7 +56,7 @@ void bind_parameters(py::module &m,const std::string name) .def("GetKeySwitchCount", &CCParams::GetKeySwitchCount) .def("GetEncryptionTechnique", &CCParams::GetEncryptionTechnique) .def("GetMultiplicationTechnique", &CCParams::GetMultiplicationTechnique) - .def("GetMultiHopModSize", &CCParams::GetMultiHopModSize) + .def("GetPRENumHops", &CCParams::GetPRENumHops) .def("GetInteractiveBootCompressionLevel", &CCParams::GetInteractiveBootCompressionLevel) // setters .def("SetPlaintextModulus", &CCParams::SetPlaintextModulus) @@ -86,7 +86,7 @@ void bind_parameters(py::module &m,const std::string name) .def("SetKeySwitchCount", &CCParams::SetKeySwitchCount) .def("SetEncryptionTechnique", &CCParams::SetEncryptionTechnique) .def("SetMultiplicationTechnique", &CCParams::SetMultiplicationTechnique) - .def("SetMultiHopModSize", &CCParams::SetMultiHopModSize) + .def("SetPRENumHops", &CCParams::SetPRENumHops) .def("SetInteractiveBootCompressionLevel", &CCParams::SetInteractiveBootCompressionLevel) .def("__str__",[](const CCParams ¶ms) { std::stringstream stream; @@ -930,13 +930,11 @@ void bind_enums_and_constants(py::module &m) .value("NOT_SET", ProxyReEncryptionMode::NOT_SET) .value("INDCPA", ProxyReEncryptionMode::INDCPA) .value("FIXED_NOISE_HRA", ProxyReEncryptionMode::FIXED_NOISE_HRA) - .value("NOISE_FLOODING_HRA", ProxyReEncryptionMode::NOISE_FLOODING_HRA) - .value("DIVIDE_AND_ROUND_HRA", ProxyReEncryptionMode::DIVIDE_AND_ROUND_HRA); + .value("NOISE_FLOODING_HRA", ProxyReEncryptionMode::NOISE_FLOODING_HRA); m.attr("NOT_SET") = py::cast(ProxyReEncryptionMode::NOT_SET); m.attr("INDCPA") = py::cast(ProxyReEncryptionMode::INDCPA); m.attr("FIXED_NOISE_HRA") = py::cast(ProxyReEncryptionMode::FIXED_NOISE_HRA); m.attr("NOISE_FLOODING_HRA") = py::cast(ProxyReEncryptionMode::NOISE_FLOODING_HRA); - m.attr("DIVIDE_AND_ROUND_HRA") = py::cast(ProxyReEncryptionMode::DIVIDE_AND_ROUND_HRA); // MultipartyMode py::enum_(m, "MultipartyMode") diff --git a/src/lib/binfhe_bindings.cpp b/src/lib/binfhe_bindings.cpp index 8c8fab8..e85069c 100644 --- a/src/lib/binfhe_bindings.cpp +++ b/src/lib/binfhe_bindings.cpp @@ -52,15 +52,15 @@ void bind_binfhe_enums(py::module &m) .value("STD192Q", BINFHE_PARAMSET::STD192Q) .value("STD256Q", BINFHE_PARAMSET::STD256Q) .value("STD128_3", BINFHE_PARAMSET::STD128_3) - .value("STD128_3_LMKCDEY", BINFHE_PARAMSET::STD128_3_LMKCDEY) + // .value("STD128_3_LMKCDEY", BINFHE_PARAMSET::STD128_3_LMKCDEY) .value("STD128Q_3", BINFHE_PARAMSET::STD128Q_3) - .value("STD128Q_3_LMKCDEY", BINFHE_PARAMSET::STD128Q_3_LMKCDEY) + // .value("STD128Q_3_LMKCDEY", BINFHE_PARAMSET::STD128Q_3_LMKCDEY) .value("STD192Q_3", BINFHE_PARAMSET::STD192Q_3) .value("STD256Q_3", BINFHE_PARAMSET::STD256Q_3) .value("STD128_4", BINFHE_PARAMSET::STD128_4) - .value("STD128_4_LMKCDEY", BINFHE_PARAMSET::STD128_4_LMKCDEY) + // .value("STD128_4_LMKCDEY", BINFHE_PARAMSET::STD128_4_LMKCDEY) .value("STD128Q_4", BINFHE_PARAMSET::STD128Q_4) - .value("STD128Q_4_LMKCDEY", BINFHE_PARAMSET::STD128Q_4_LMKCDEY) + // .value("STD128Q_4_LMKCDEY", BINFHE_PARAMSET::STD128Q_4_LMKCDEY) .value("STD192Q_4", BINFHE_PARAMSET::STD192Q_4) .value("STD256Q_4", BINFHE_PARAMSET::STD256Q_4) .value("SIGNED_MOD_TEST", BINFHE_PARAMSET::SIGNED_MOD_TEST); @@ -76,15 +76,15 @@ void bind_binfhe_enums(py::module &m) m.attr("STD192Q") = py::cast(BINFHE_PARAMSET::STD192Q); m.attr("STD256Q") = py::cast(BINFHE_PARAMSET::STD256Q); m.attr("STD128_3") = py::cast(BINFHE_PARAMSET::STD128_3); - m.attr("STD128_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_3_LMKCDEY); + // m.attr("STD128_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_3_LMKCDEY); m.attr("STD128Q_3") = py::cast(BINFHE_PARAMSET::STD128Q_3); - m.attr("STD128Q_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_3_LMKCDEY); + // m.attr("STD128Q_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_3_LMKCDEY); m.attr("STD192Q_3") = py::cast(BINFHE_PARAMSET::STD192Q_3); m.attr("STD256Q_3") = py::cast(BINFHE_PARAMSET::STD256Q_3); m.attr("STD128_4") = py::cast(BINFHE_PARAMSET::STD128_4); - m.attr("STD128_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_4_LMKCDEY); + // m.attr("STD128_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_4_LMKCDEY); m.attr("STD128Q_4") = py::cast(BINFHE_PARAMSET::STD128Q_4); - m.attr("STD128Q_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_4_LMKCDEY); + // m.attr("STD128Q_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_4_LMKCDEY); m.attr("STD192Q_4") = py::cast(BINFHE_PARAMSET::STD192Q_4); m.attr("STD256Q_4") = py::cast(BINFHE_PARAMSET::STD256Q_4); m.attr("SIGNED_MOD_TEST") = py::cast(BINFHE_PARAMSET::SIGNED_MOD_TEST); @@ -160,7 +160,7 @@ void bind_binfhe_context(py::module &m) py::arg("set"), py::arg("method") = GINX) //void GenerateBinFHEContext(BINFHE_PARAMSET set, bool arbFunc, uint32_t logQ = 11, int64_t N = 0, BINFHE_METHOD method = GINX, bool timeOptimization = false) - .def("GenerateBinFHEContext", static_cast(&BinFHEContext::GenerateBinFHEContext), + .def("GenerateBinFHEContext", static_cast(&BinFHEContext::GenerateBinFHEContext), binfhe_GenerateBinFHEContext_docs, py::arg("set"), py::arg("arbFunc"), From d8d25cdf160de4c60696f7ceefcbb130f35dbe6f Mon Sep 17 00:00:00 2001 From: Yuriy Polyakov Date: Tue, 25 Jun 2024 15:39:31 -0400 Subject: [PATCH 3/4] fixes for v1.2.0 + incremented to v0.8.8 --- CMakeLists.txt | 2 +- src/lib/binfhe_bindings.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f2e7d0..68cc2d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project (OpenFHE-Python) set(OPENFHE_PYTHON_VERSION_MAJOR 0) set(OPENFHE_PYTHON_VERSION_MINOR 8) -set(OPENFHE_PYTHON_VERSION_PATCH 7) +set(OPENFHE_PYTHON_VERSION_PATCH 8) set(OPENFHE_PYTHON_VERSION ${OPENFHE_PYTHON_VERSION_MAJOR}.${OPENFHE_PYTHON_VERSION_MINOR}.${OPENFHE_PYTHON_VERSION_PATCH}) set(CMAKE_CXX_STANDARD 17) diff --git a/src/lib/binfhe_bindings.cpp b/src/lib/binfhe_bindings.cpp index e85069c..f743673 100644 --- a/src/lib/binfhe_bindings.cpp +++ b/src/lib/binfhe_bindings.cpp @@ -52,15 +52,15 @@ void bind_binfhe_enums(py::module &m) .value("STD192Q", BINFHE_PARAMSET::STD192Q) .value("STD256Q", BINFHE_PARAMSET::STD256Q) .value("STD128_3", BINFHE_PARAMSET::STD128_3) - // .value("STD128_3_LMKCDEY", BINFHE_PARAMSET::STD128_3_LMKCDEY) + .value("STD128_3_LMKCDEY", BINFHE_PARAMSET::STD128_3_LMKCDEY) .value("STD128Q_3", BINFHE_PARAMSET::STD128Q_3) - // .value("STD128Q_3_LMKCDEY", BINFHE_PARAMSET::STD128Q_3_LMKCDEY) + .value("STD128Q_3_LMKCDEY", BINFHE_PARAMSET::STD128Q_3_LMKCDEY) .value("STD192Q_3", BINFHE_PARAMSET::STD192Q_3) .value("STD256Q_3", BINFHE_PARAMSET::STD256Q_3) .value("STD128_4", BINFHE_PARAMSET::STD128_4) - // .value("STD128_4_LMKCDEY", BINFHE_PARAMSET::STD128_4_LMKCDEY) + .value("STD128_4_LMKCDEY", BINFHE_PARAMSET::STD128_4_LMKCDEY) .value("STD128Q_4", BINFHE_PARAMSET::STD128Q_4) - // .value("STD128Q_4_LMKCDEY", BINFHE_PARAMSET::STD128Q_4_LMKCDEY) + .value("STD128Q_4_LMKCDEY", BINFHE_PARAMSET::STD128Q_4_LMKCDEY) .value("STD192Q_4", BINFHE_PARAMSET::STD192Q_4) .value("STD256Q_4", BINFHE_PARAMSET::STD256Q_4) .value("SIGNED_MOD_TEST", BINFHE_PARAMSET::SIGNED_MOD_TEST); @@ -76,15 +76,15 @@ void bind_binfhe_enums(py::module &m) m.attr("STD192Q") = py::cast(BINFHE_PARAMSET::STD192Q); m.attr("STD256Q") = py::cast(BINFHE_PARAMSET::STD256Q); m.attr("STD128_3") = py::cast(BINFHE_PARAMSET::STD128_3); - // m.attr("STD128_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_3_LMKCDEY); + m.attr("STD128_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_3_LMKCDEY); m.attr("STD128Q_3") = py::cast(BINFHE_PARAMSET::STD128Q_3); - // m.attr("STD128Q_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_3_LMKCDEY); + m.attr("STD128Q_3_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_3_LMKCDEY); m.attr("STD192Q_3") = py::cast(BINFHE_PARAMSET::STD192Q_3); m.attr("STD256Q_3") = py::cast(BINFHE_PARAMSET::STD256Q_3); m.attr("STD128_4") = py::cast(BINFHE_PARAMSET::STD128_4); - // m.attr("STD128_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_4_LMKCDEY); + m.attr("STD128_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128_4_LMKCDEY); m.attr("STD128Q_4") = py::cast(BINFHE_PARAMSET::STD128Q_4); - // m.attr("STD128Q_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_4_LMKCDEY); + m.attr("STD128Q_4_LMKCDEY") = py::cast(BINFHE_PARAMSET::STD128Q_4_LMKCDEY); m.attr("STD192Q_4") = py::cast(BINFHE_PARAMSET::STD192Q_4); m.attr("STD256Q_4") = py::cast(BINFHE_PARAMSET::STD256Q_4); m.attr("SIGNED_MOD_TEST") = py::cast(BINFHE_PARAMSET::SIGNED_MOD_TEST); From 031e12817929cac4e0d94c3597f64c38c24b1d13 Mon Sep 17 00:00:00 2001 From: yspolyakov <89226542+yspolyakov@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:26:34 -0400 Subject: [PATCH 4/4] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68cc2d8..1f6c9ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ if(APPLE) set(CMAKE_CXX_VISIBILITY_PRESET default) endif() -find_package(OpenFHE 1.1.3 REQUIRED) +find_package(OpenFHE 1.2.0 REQUIRED) find_package(pybind11 REQUIRED) set( CMAKE_CXX_FLAGS ${OpenFHE_CXX_FLAGS} )