diff --git a/src/wrapper.cpp b/src/wrapper.cpp index bd1e602..32dee4d 100644 --- a/src/wrapper.cpp +++ b/src/wrapper.cpp @@ -384,6 +384,20 @@ PYBIND11_MODULE(seal, m) }) ; + // serializable.h + py::class_>(m, "SerializableGaloisKeys") + .def("save", [](const Serializable &gk, const std::string &path){ + std::ofstream out(path, std::ofstream::binary); + gk.save(out); + out.close(); + }) + .def("dumpb", [](const Serializable &gk){ + std::stringstream out(std::ios::binary | std::ios::out); + gk.save(out); + return py::bytes(out.str()); + }) + ; + // keygenerator.h py::class_(m, "KeyGenerator") .def(py::init()) @@ -407,7 +421,11 @@ PYBIND11_MODULE(seal, m) GaloisKeys gk; keygen.create_galois_keys(gk); return gk; - }); + }) + .def("create_serializable_galois_keys", [](KeyGenerator &keygen){ + return keygen.create_galois_keys(); + }) + ; // encryptor.h py::class_(m, "Encryptor")