fix(safe_ser): aliases in named for renamed types deserialization #1982
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes: please link all relevant issues
PR content/description
Adds the possibility to have aliases in the Named trait.
Context:
In previous versions of TFHE-rs only the
CompactPkePublicParams
were serializable. Since 0.11, theCompactPkeCrs
is the main exposed type and is serializable. For versioning, there is an upgrade path that allows to load and upgrade an oldCompactPkePublicParams
into a newCompactPkeCrs
. However this could not work in practice forCompactPkePublicParams
serialized withsafe_serialize
because of theNamed
impl was different and the data was rejected in the header check.This PR allows to have aliases to a name, that will be accepted when loading this name. This is optional so it does not break previous code. That way, "zk::CompactPkePublicParams" is seen as an alias for "zk::CompactPkeCrs".