Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/include/docstrings/cryptocontext_docs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,12 +1117,19 @@ const char* cc_IntMPBootEncrypt_docs = R"pbdoc(
)pbdoc";

const char* cc_InsertEvalMultKey_docs = R"pbdoc(
InsertEvalMultKey - add the given vector of keys to the map, replacing the existing vector if there
Adds the given vector of keys to the map, replacing the existing vector if there

:param evalKeyVec: vector of keys
:type evalKeyVec: List[EvalKey]
)pbdoc";

const char* cc_InsertEvalAutomorphismKey_docs = R"pbdoc(
Add the given map of keys to the map, replacing the existing map if there is

:param evalKeyMap: map of keys
:type EvalKeyMap
)pbdoc";

const char* cc_EvalSum_docs = R"pbdoc(
Function for evaluating a sum of all components in a vector.

Expand Down
12 changes: 8 additions & 4 deletions src/lib/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void bind_crypto_context(py::module &m)
const PrivateKey<DCRTPoly>& privateKey,
std::shared_ptr<std::map<unsigned int, EvalKey<DCRTPoly>>> evalKeyMap,
const std::vector<int32_t>& indexList,
const std::string& keyId) {
const std::string& keyId = "") {
return self->MultiEvalAtIndexKeyGen(privateKey, evalKeyMap, indexList, keyId);
},
cc_MultiEvalAtIndexKeyGen_docs,
Expand Down Expand Up @@ -749,14 +749,18 @@ void bind_crypto_context(py::module &m)
cc_InsertEvalMultKey_docs,
py::arg("evalKeyVec"),
py::arg("keyTag") = "")
.def_static(
"InsertEvalAutomorphismKey", &CryptoContextImpl<DCRTPoly>::InsertEvalAutomorphismKey,
cc_InsertEvalAutomorphismKey_docs,
py::arg("evalKeyMap"),
py::arg("keyTag") = "")
.def_static(
"ClearEvalAutomorphismKeys", []()
{ CryptoContextImpl<DCRTPoly>::ClearEvalAutomorphismKeys(); },
cc_ClearEvalAutomorphismKeys_docs)
.def_static("GetEvalAutomorphismKeyMap", &CryptoContextImpl<DCRTPoly>::GetEvalAutomorphismKeyMap,
.def_static("GetEvalAutomorphismKeyMap", &CryptoContextImpl<DCRTPoly>::GetEvalAutomorphismKeyMapPtr,
cc_GetEvalAutomorphismKeyMap_docs,
py::arg("keyId") = "",
py::return_value_policy::reference)
py::arg("keyId") = "")
.def("GetEvalSumKeyMap", &GetEvalSumKeyMapWrapper,
cc_GetEvalSumKeyMap_docs)
.def("GetBinCCForSchemeSwitch", &CryptoContextImpl<DCRTPoly>::GetBinCCForSchemeSwitch)
Expand Down
8 changes: 4 additions & 4 deletions src/lib/pke/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ void bind_serialization(pybind11::module &m) {
m.def("SerializeEvalMultKeyString", &SerializeEvalMultKeyToStringWrapper<SerType::SERJSON>,
py::arg("sertype"), py::arg("id") = "");
m.def("DeserializeEvalMultKeyString", &DeserializeEvalMultKeyFromStringWrapper<SerType::SERJSON>,
py::arg("sertype"), py::arg("id") = "");
py::arg("data"), py::arg("sertype"));
m.def("SerializeEvalAutomorphismKeyString", &SerializeEvalAutomorphismKeyToStringWrapper<SerType::SERJSON>,
py::arg("sertype"), py::arg("id") = "");
m.def("DeserializeEvalAutomorphismKeyString", &DeserializeEvalAutomorphismKeyFromStringWrapper<SerType::SERJSON>,
py::arg("sertype"), py::arg("id") = "");
py::arg("data"), py::arg("sertype"));

// Binary Serialization
m.def("SerializeToFile", static_cast<bool (*)(const std::string&,const CryptoContext<DCRTPoly>&, const SerType::SERBINARY&)>(&Serial::SerializeToFile<DCRTPoly>),
Expand Down Expand Up @@ -315,9 +315,9 @@ void bind_serialization(pybind11::module &m) {
m.def("SerializeEvalMultKeyString", &SerializeEvalMultKeyToBytesWrapper<SerType::SERBINARY>,
py::arg("sertype"), py::arg("id") = "");
m.def("DeserializeEvalMultKeyString", &DeserializeEvalMultKeyFromBytesWrapper<SerType::SERBINARY>,
py::arg("sertype"), py::arg("id") = "");
py::arg("data"), py::arg("sertype"));
m.def("SerializeEvalAutomorphismKeyString", &SerializeEvalAutomorphismKeyToBytesWrapper<SerType::SERBINARY>,
py::arg("sertype"), py::arg("id") = "");
m.def("DeserializeEvalAutomorphismKeyString", &DeserializeEvalAutomorphismKeyFromBytesWrapper<SerType::SERBINARY>,
py::arg("sertype"), py::arg("id") = "");
py::arg("data"), py::arg("sertype"));
}