openfheorg / openfhe-python

Official Python wrapper for OpenFHE. Current release is v0.8.8 (released on June 25, 2024).
https://openfheorg.github.io/openfhe-python/html/index.html
BSD 2-Clause "Simplified" License
60 stars 18 forks source link

#145 Add Serialize/Deserialize functions #155

Open Thadah opened 3 days ago

Thadah commented 3 days ago

Follow up to the #151 PR.

Original issue:

Closes #145

Adds openfhe.Serialize() and deserialization for every object so it can do it directly into a variable rather than writing a file that has to be read afterwards. I've tested both and they're working well.

I'd have liked to use other names rather than ...String for the deserialization part. It would have made more sense to change the other function names to something like ...ToFile but since that would break a lot of existing code I'll keep it like this, unless there is a suggestion for a better name.

If you see any issue with the code or you believe it makes more sense in another file, please let me know.