From 699678b3905d914e414723ba0022d492991ada32 Mon Sep 17 00:00:00 2001 From: Dmitriy Suponitskiy Date: Thu, 24 Oct 2024 00:51:26 -0400 Subject: [PATCH] Fixed compiler bugs --- src/lib/binfhe_bindings.cpp | 16 ++++++++-------- src/lib/pke/serialization.cpp | 9 +++------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/lib/binfhe_bindings.cpp b/src/lib/binfhe_bindings.cpp index 78651b7..9f32304 100644 --- a/src/lib/binfhe_bindings.cpp +++ b/src/lib/binfhe_bindings.cpp @@ -32,9 +32,9 @@ #include "binfhecontext_docs.h" #include "binfhecontext_wrapper.h" #include "openfhe.h" -#include "openfhe/cereal/archives/binary.hpp" -#include "openfhe/cereal/archives/portable_binary.hpp" -#include "openfhe/core/utils/serial.h" +#include "cereal/archives/binary.hpp" +#include "cereal/archives/portable_binary.hpp" +#include "core/utils/serial.h" #include #include #include @@ -184,15 +184,15 @@ void bind_binfhe_context(py::module &m) { py::arg("sk"), py::arg("ct"), py::arg("p") = 4) .def("EvalBinGate", static_cast( + BINGATE, ConstLWECiphertext &, ConstLWECiphertext &, bool) const>( &BinFHEContext::EvalBinGate), binfhe_EvalBinGate_docs, py::arg("gate"), py::arg("ct1"), - py::arg("ct2")) + py::arg("ct2"), py::arg("extended") = false) .def("EvalBinGate", static_cast &) const>( + BINGATE, const std::vector &, bool) const>( &BinFHEContext::EvalBinGate), - py::arg("gate"), py::arg("ctvector")) + py::arg("gate"), py::arg("ctvector"), py::arg("extended") = false) .def("EvalNOT", &BinFHEContext::EvalNOT, binfhe_EvalNOT_docs, py::arg("ct")) .def("Getn", &GetnWrapper) @@ -212,7 +212,7 @@ void bind_binfhe_context(py::module &m) { .def("EvalNOT", &BinFHEContext::EvalNOT) .def("EvalConstant", &BinFHEContext::EvalConstant) .def("ClearBTKeys", &BinFHEContext::ClearBTKeys) - .def("Bootstrap", &BinFHEContext::Bootstrap, py::arg("ct")) + .def("Bootstrap", &BinFHEContext::Bootstrap, py::arg("ct"), py::arg("extended") = false) .def("SerializedVersion", &BinFHEContext::SerializedVersion, binfhe_SerializedVersion_docs) .def("SerializedObjectName", &BinFHEContext::SerializedObjectName, diff --git a/src/lib/pke/serialization.cpp b/src/lib/pke/serialization.cpp index b1b89a8..c9860a1 100644 --- a/src/lib/pke/serialization.cpp +++ b/src/lib/pke/serialization.cpp @@ -47,8 +47,7 @@ template bool SerializeEvalMultKeyWrapper(const std::string &filename, const ST &sertype, std::string id) { std::ofstream outfile(filename, std::ios::out | std::ios::binary); - bool res; - res = CryptoContextImpl::SerializeEvalMultKey(outfile, sertype, id); + bool res = CryptoContextImpl::SerializeEvalMultKey(outfile, sertype, id); outfile.close(); return res; } @@ -57,8 +56,7 @@ template bool SerializeEvalAutomorphismKeyWrapper(const std::string& filename, const ST& sertype, std::string id) { std::ofstream outfile(filename, std::ios::out | std::ios::binary); - bool res; - res = CryptoContextImpl::SerializeEvalAutomorphismKey(outfile, sertype, id); + bool res = CryptoContextImpl::SerializeEvalAutomorphismKey(outfile, sertype, id); outfile.close(); return res; } @@ -71,8 +69,7 @@ bool DeserializeEvalMultKeyWrapper(const std::string &filename, const ST &sertyp { std::cerr << "I cannot read serialization from " << filename << std::endl; } - bool res; - res = CryptoContextImpl::DeserializeEvalMultKey(emkeys, sertype); + bool res = CryptoContextImpl::DeserializeEvalMultKey(emkeys, sertype); return res; } template