clearmatics / libff

C++ library for Finite Fields and Elliptic Curves (forked from scipr-lab/libff)
https://clearmatics.github.io/libff/
Other
3 stars 2 forks source link

serialization parameter(s) to control safe / unsafe deserialization #55

Open dtebbs opened 3 years ago

dtebbs commented 3 years ago

The current generic serialization routine group_read do not check that the group element is on the curve (in the uncompressed case), and a member of the correct subgroup. Similarly, In the compressed case, group_read does not check that the x-coordinate is valid.

These checks add to the cost of deserialization and may be undesirable where incoming data in known to be valid (e.g. some MSM experiments where intermediate values are cached to disk), but it would be convenient (and in some cases, necessary) to be able to enable/disable checks with a parameter similar to compressed/uncompressed.