-
Notifications
You must be signed in to change notification settings - Fork 83
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
Switch curve_name from string to NamedTuple #57
Comments
This would happen in the second phase of the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
py_ecc/fields/__init__.py
has a lot of duplications and is at high risk of typos (like importing the coeffs or field modulus from the wrong curve).Let's think about alternatives to this setup. Maybe something like:
^ This still doesn't feel quite right, but it's a starting point.
The end goal is to be able to create
bn128_FQ2
with a reference to a single thing (like this newNamedTuple
)Of course, this approach comes at the downside of having to import the curve to create an
FQ
. Maybe a little more annoying at the REPL. But for the caller in a file, it means fewer magic strings and less likelihood for a typo with a confusing error. For the library, hopefully better readability.Originally posted by @carver in https://github.com/_render_node/MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0OTIyNTg5NQ==/comments/review_comment
The text was updated successfully, but these errors were encountered: