-
Notifications
You must be signed in to change notification settings - Fork 45
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
Expand api #4
Expand api #4
Conversation
@LucasLvy added the docs and implemented |
I also left a TODO in the |
Just fixed the failing check, forgot to run |
@tdelabro @LucasLvy I'll be thinking about how to improve the arbitrary implementation. Do you mind checking the other changes in the meantime to win some time? |
Heh, forgot to enable the feature when testing locally 🤦 |
I think there is a problem in the features (some missing imports for some feature) @Oppen |
Yes, I mistakenly thought some |
(Self(FieldElement::from(&q)), Self(FieldElement::from(&r))) | ||
} | ||
|
||
/// Multiplicative inverse inside field. | ||
pub fn inverse(&self) -> Option<Self> { |
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.
You can probably use this num-trait trait: https://docs.rs/num-traits/latest/num_traits/ops/inv/trait.Inv.html
&(self.0).representative().div_rem(&n.0.representative()).1, | ||
)) | ||
/// Raises `self` to the power of `exponent`. | ||
pub fn pow_felt(&self, exponent: &Felt) -> Self { |
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.
use bitvec::array::BitArray; | ||
use num_traits::{FromPrimitive, ToPrimitive, Zero}; |
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.
you should probably add the one trait: https://docs.rs/num-traits/latest/num_traits/identities/trait.One.html
@Oppen Do you want to merge it here and keep the last conversation for further PR? |
I think that would be good. Could you extract those to an issue so we don't forget? |
Feature
Expand APIs
arbitrary
feature for fuzzers using thearbitrary
cratep'
Does this introduce a breaking change?
No