-
Notifications
You must be signed in to change notification settings - Fork 92
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
Use const fn instead of const macros #39
Conversation
If you want to review the large diffs of |
@@ -11,5 +11,5 @@ matrix: | |||
- beta | |||
script: | |||
- cargo build --verbose --all | |||
- cargo test --verbose --all | |||
- cargo test --verbose |
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.
The noconst
feature is currently necessary for gen_ecmult
and gen_genmult
, but if it's enabled, then tests won't work, because nearly all user-facing functions depend on those constants. In the future, switching to build script will fix this.
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.
LGTM, it might be worth to add annotations to n
(see inline)
I am not sure if the failing tests are ok, I also did not review the generated files full of constants. |
@drahnr Which tests are failing? |
Nevermind, looks good to me :) |
* Use const fn instead of const macros * Build and test only main crate * Still able to build all, but not test all * Add description how Field n value is stored * Clarify that the least signficant bit is in the front * Bit -> byte
This removes
field_const
,field_storage_const
,field_const_raw
,affine_const
,jacobian_const
macros, and replaces them with const fnsField::new
,FieldStorage::new
,Field::new_raw
,Affine::new
,Jacobian::new
.