Skip to content

Commit 0aec0cc

Browse files
#127: Add missing methods to the Python API (#140)
- add EvalLinearWSum, EvalMultMany, EvalAddManyInPlace, EvalLinearWSumMutable
1 parent 10a6163 commit 0aec0cc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/lib/bindings.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,24 @@ void bind_crypto_context(py::module &m)
691691
py::arg("privateKey"),
692692
py::arg("indexList"),
693693
py::return_value_policy::reference_internal)
694+
.def("EvalLinearWSumMutable",
695+
static_cast<lbcrypto::Ciphertext<DCRTPoly> (lbcrypto::CryptoContextImpl<DCRTPoly>::*)(
696+
const std::vector<double>&,
697+
std::vector<std::shared_ptr<lbcrypto::CiphertextImpl<DCRTPoly> > >&
698+
) const>(
699+
&CryptoContextImpl<DCRTPoly>::EvalLinearWSumMutable),
700+
py::arg("ciphertext"),
701+
py::arg("coefficients"))
702+
.def("EvalLinearWSum",
703+
static_cast<lbcrypto::Ciphertext<DCRTPoly> (lbcrypto::CryptoContextImpl<DCRTPoly>::*)(
704+
std::vector<std::shared_ptr<const lbcrypto::CiphertextImpl<DCRTPoly> > >&,const std::vector<double>&) const>(
705+
&CryptoContextImpl<DCRTPoly>::EvalLinearWSum),
706+
py::arg("ciphertext"),
707+
py::arg("coefficients"))
708+
.def("EvalMultMany", &CryptoContextImpl<DCRTPoly>::EvalMultMany,
709+
py::arg("ciphertextVec"))
710+
.def("EvalAddManyInPlace", &CryptoContextImpl<DCRTPoly>::EvalAddManyInPlace,
711+
py::arg("ciphertextVec"))
694712
.def("FindAutomorphismIndex", &CryptoContextImpl<DCRTPoly>::FindAutomorphismIndex,
695713
cc_FindAutomorphismIndex_docs,
696714
py::arg("idx"))

0 commit comments

Comments
 (0)