-
Notifications
You must be signed in to change notification settings - Fork 219
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 unchecked serialization/deserialization #253
Conversation
859990a
to
b180783
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is probably the cleaner way to do it. 👍
One remark though: The _unchecked
variants are now incompatible with the _uncompressed
methods for serialization/deserialization. The _unchecked
implementations write the infinity bit explicitly into its own byte, while the _uncompressed
code encodes it into the non-used bits.
Did you choose to use an explicit bool for performance reasons?
If yes, I think adding a note to the documentation would be good, indicating this difference.
I did omit the flag handling for affine structs for performance reasons, but I should check that it actually makes a difference by benchmarking. |
b180783
to
b0ca62e
Compare
This is very useful! I actually might need something like this soon. |
b0ca62e
to
9719145
Compare
Indeed, most of the overhead is due to the prime-group check. |
b0073f5
to
646a6e2
Compare
646a6e2
to
811e697
Compare
Add unchecked serialization and deserialization, for the case when one knows that the serialized output will be stored in a trusted location (for example: serialized and deserialized by the same machine).
cc @ChaitanyaKonda @iAmMichaelConnor, this might solve your use case in a cleaner way.
cc also @kobigurk @paberr