-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add traits to connect integers and residue represenations #431
Conversation
Elsewhere It might be good to consider the naming for these traits in conjunction with #351 |
Instead of |
I wasn't sure if bundling everything into one trait is a good idea. But I don't insist on it. |
Well, if we do end up putting it in its own trait, it seems like a good trait for |
f7f1752
to
6336108
Compare
HasResidueRepr
and ResidueRepr
traits to connect integers and residue represenations
Can't make it a draft, but I'm still working on it: adding trait bounds to the Montgomery trait to make it more like One problem not sure how to solve: the current trait bound on |
Sure, you can remove |
No, I meant remove the bound but keep the trait. That should be enough. |
Ok this should be ready for review now. |
Will look if you want to remove |
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.
One suggestion but this looks fine
A part of #348
Fixes #448
All the naming is up for debate (see also #351)
Monty
associated type toInteger
linking it to the corresponding Montgomery formMonty
trait with an associated type linking back to the correspondingInteger
and a bunch of bounds (similar toInteger
)Square
which made it hard to makeSquare
a bound to other traits. This means that there's no default implementation anymore.SquareAssign
trait.I will make a separate PR adding
div_by_2()
toMonty
after #436 is merged