Skip to content
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

Remove operations on full-group elements from the public API #41

Open
str4d opened this issue Aug 13, 2020 · 0 comments
Open

Remove operations on full-group elements from the public API #41

str4d opened this issue Aug 13, 2020 · 0 comments

Comments

@str4d
Copy link
Member

str4d commented Aug 13, 2020

G1 and G2 are prime-order subgroups, but they currently have several public APIs that don't apply to prime-order groups:

  • G1Affine::is_torsion_free
  • G1Affine::is_on_curve
  • G1Projective::clear_cofactor
  • G1Projective::is_on_curve
  • Similarly for G2Affine and G2Projective.

The is_* APIs are all documented as "Always returns true unless the unchecked APIs were [mis]used". Meanwhile, clear_cofactor (added in #18) is defined as mapping elliptic curve points to elements of G{1,2}, but the type it is defined on is already an element of G{1,2}.

These APIs were implemented because of the G*Affine::from_[un]compressed_unchecked APIs, which can technically be used to load full-group elements, but doing so is explicitly breaking the requirements set by the *_unchecked APIs, so this shouldn't be a supported case.

We should make the above APIs private (all except G*Projective::is_on_curve are used internally), and then consider on a case-by-case basis how to handle full-group elements (which in general we do not want to expose or support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant