File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,20 @@ PYBIND11_MODULE(seal, m)
384
384
})
385
385
;
386
386
387
+ // serializable.h
388
+ py::class_<Serializable<GaloisKeys>>(m, " SerializableGaloisKeys" )
389
+ .def (" save" , [](const Serializable<GaloisKeys> &gk, const std::string &path){
390
+ std::ofstream out (path, std::ofstream::binary);
391
+ gk.save (out);
392
+ out.close ();
393
+ })
394
+ .def (" dumpb" , [](const Serializable<GaloisKeys> &gk){
395
+ std::stringstream out (std::ios::binary | std::ios::out);
396
+ gk.save (out);
397
+ return py::bytes (out.str ());
398
+ })
399
+ ;
400
+
387
401
// keygenerator.h
388
402
py::class_<KeyGenerator>(m, " KeyGenerator" )
389
403
.def (py::init<const SEALContext &>())
@@ -407,7 +421,11 @@ PYBIND11_MODULE(seal, m)
407
421
GaloisKeys gk;
408
422
keygen.create_galois_keys (gk);
409
423
return gk;
410
- });
424
+ })
425
+ .def (" create_serializable_galois_keys" , [](KeyGenerator &keygen){
426
+ return keygen.create_galois_keys ();
427
+ })
428
+ ;
411
429
412
430
// encryptor.h
413
431
py::class_<Encryptor>(m, " Encryptor" )
You can’t perform that action at this time.
0 commit comments