-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Serialization/Deserialization for all keys #3
Comments
Commit 5bf8e16 implements serialization/deserialization for I checked that serialized objects are of expected size in bytes by first estimating the sizes by hand and then converting the types to respective serialized types and then to bytes. Eveything looks correct. |
I seem to have made a mistake by allowing To avoid this, I think it is ok to forbid serliization of polynomial in |
Commit db97066 adds support for seeded |
I have been contemplating to switch |
Add serialization/deserialization for Poly, Ciphertext, KeySwitchingKey, RelinerizationKey, GaloisKey.
Since all keys depend on Poly and poly only consists of coefficients (ie
Array2
) and representation, the only important functions are converting vector of u64s (ie each row in Array2) to bytes and back.I have already implemented functions to convert vector of u64s assumed to be in range [0, modulus) to bytes and back. Check convert_to_bytes and convert_from_bytes.
I have also added a rough way to convert
Poly
toproto::Poly
here.Conversion of
proto::Poly
to bytes is behaving as expected. For example, aPoly
with modulusQ
of size 500 bits (ie moduli chain =[50;10]
) and degree2^15
should take500*(2^15)/8 = 2048000
bytes (ignoring representation value). I can confirm that converting such aPoly
toproto::Poly
and encoding converted value in bytes equals to2048052
bytes, which is only a difference of 52 bytes.The text was updated successfully, but these errors were encountered: