-
Notifications
You must be signed in to change notification settings - Fork 236
Move function requiring AffinePoint
from EdwardsPoint
to AffinePoint
#1333
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
base: master
Are you sure you want to change the base?
Conversation
deecb76
to
6b929cf
Compare
c452dc0
to
ab14e29
Compare
This is definitely pushing my knowledge of both Edwards curves and Ed448-Goldilocks, and sent me on a rabbit hole reading the paper. I think both versions of
Edit: opened an issue about this #1349, and it seems to be the reason you weren't seeing speedups using twisted scalar multiplication in #1337 |
To expound on that:
Conversions look like:
...but I think it's fine to preserve methods like Likewise, scalar multiplication would ideally do a more direct conversion from |
I hope I'm on the right track here? I'm kinda trying to align things with the other RustCrypto crates, where most types have very few methods and its all mostly implemented through traits. It also makes sense to me, because otherwise we have all those duplicate methods. |
Putting on draft until I rebase. Still working on those optimized implementations from #1316. |
@@ -61,7 +64,7 @@ impl ExpandedSecretKey { | |||
|
|||
let point = EdwardsPoint::GENERATOR * scalar; | |||
let public_key = VerifyingKey { | |||
compressed: point.compress(), | |||
compressed: point.to_affine().compress(), |
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.
Couldn't remove this because we are storing CompressedEdwardsY
in VerifyingKey
and GroupEncoding
doesn't return that.
I'm happy to change the type.
I'm planning on removing the type entirely anyway to align with the other curves in this repo, so we can wait for that as well.
A bunch of functionality implemented on
EdwardsPoint
internally just converts toAffinePoint
. This functionality should rather live inAffinePoint
.This PR also implement
BatchNormalize
forEdwardsPoint
, which wouldn't have much of a point without these changes to begin with.