zama-ai / tfhe-rs

TFHE-rs: A Pure Rust implementation of the TFHE Scheme for Boolean and Integer Arithmetics Over Encrypted Data.
Other
831 stars 127 forks source link

feat(all): add `safe_serialize_versioned` #1252

Closed nsarlin-zama closed 2 weeks ago

nsarlin-zama commented 2 weeks ago

closes: please link all relevant issues

PR content/description

Adds a few methods for versioned serializations:

To avoid conflict with the SERIALIZATION_VERSION, a different number VERSIONING_VERSION is used to record the version of the versioning scheme that has been used. A specific header type has been created that will be embed inside the serialized packet and records if the message is versioned or not. To be compatible with other message serialized with previous 0.6, this header is not used for messages that are not versioned.

However this might be useless in the future since the SERIALIZATION_VERSION should not evolve anymore when versioning will be used by default.

Check-list: