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

Document the purpose of point.canonical() #11

Open
wyatt-howe opened this issue May 7, 2024 · 0 comments
Open

Document the purpose of point.canonical() #11

wyatt-howe opened this issue May 7, 2024 · 0 comments
Assignees

Comments

@wyatt-howe
Copy link
Member

Document the purpose of point.canonical(), performance benefit, equality of the bytes returned by point.to_bytes().

We just need to be clear that the bytes spit out (when you type a point variable into the interpreter, or print .to_bytes()) for p1 and p2 where p1 == p2 are not always the same.

Then, we can have .to_bytes(canonicalize=True) be the default and clarify that .to_bytes(canonicalize=False) is faster if you aren't doing byte-to-byte comparisons or other derivations directly from the bytes spit out.

Users of this library need to know that assert (p1.to_bytes() == p2.to_bytes()) == (p1 == p2) will sometimes fail, depending on how the points were computed (due to algorithms for computing point operations using optimizations such as using Jacobi coordinates x,y,z to represent points vs affine coordinates x,y and so on).

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

2 participants