Skip to content

Commit 56306c6

Browse files
EvalSumRowsKeyGen() returns the native type instead of py::dict
1 parent d7af659 commit 56306c6

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

src/lib/bindings.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -760,11 +760,7 @@ void bind_crypto_context(py::module &m) {
760760
const PrivateKey<DCRTPoly> privateKey,
761761
uint32_t rowSize,
762762
uint32_t subringDim) {
763-
auto m = self.EvalSumRowsKeyGen(privateKey, rowSize, subringDim);
764-
py::dict d;
765-
for (const auto& [k, v] : *m)
766-
d[py::int_(k)] = v;
767-
return d;
763+
return self.EvalSumRowsKeyGen(privateKey, rowSize, subringDim);
768764
},
769765
py::arg("privateKey"),
770766
py::arg("rowSize") = 0,
@@ -776,16 +772,13 @@ void bind_crypto_context(py::module &m) {
776772
const PublicKey<DCRTPoly> publicKey,
777773
uint32_t rowSize,
778774
uint32_t subringDim) {
779-
auto m = self.EvalSumRowsKeyGen(privateKey, publicKey, rowSize, subringDim);
780-
py::dict d;
781-
for (const auto& [k, v] : *m)
782-
d[py::int_(k)] = v;
783-
return d;
775+
return self.EvalSumRowsKeyGen(privateKey, publicKey, rowSize, subringDim);
784776
},
785777
py::arg("privateKey"),
786778
py::arg("publicKey"),
787779
py::arg("rowSize") = 0,
788-
py::arg("subringDim") = 0)
780+
py::arg("subringDim") = 0,
781+
py::doc(cc_EvalSumRowsKeyGen_docs))
789782
// TODO (Oliveira, R.): Solve pointer handling bug when dealing with EvalKeyMap object for the next functions
790783
.def("EvalSumColsKeyGen", &CryptoContextImpl<DCRTPoly>::EvalSumColsKeyGen,
791784
py::arg("privateKey"),

0 commit comments

Comments
 (0)