-
Notifications
You must be signed in to change notification settings - Fork 267
feat: hash to curve #495
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
feat: hash to curve #495
Conversation
|
|
||
| # optional dependencies | ||
| ecdsa-core = { version = "0.13", package = "ecdsa", optional = true, default-features = false, features = ["der"] } | ||
| hash2field = { version = "0.4", optional = true } |
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.
@tarcieri Maybe it's worth to incorporate this crate into elliptic-curve?
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.
@mikelodder7 would you be interested in upstreaming hash2field somewhere, either elliptic-curve or possibly ff?
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.
Sure thing. Elliptic-curve probably makes more sense but I can be convinced otherwise
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.
Sounds good!
If you're up for it, I think it might also be possible to extract a generic implementation of SSWU, although I'm fine with duplication for now and I can try to extract it as part of a follow-up:
You can use e.g. ff::{Field, PrimeField} as the bounds, and I can look into ensuring they're impl'd for the respective FieldElement types in k256 and p256.
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.
Yeah if ff::Field is impl'd then the dedup is easy from there. osswu will just have to take a set of params but otherwise, they'll be the same. Should osswu go upstream as well in elliptic-curve?
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.
I think it'd be great if you can add a generic implementation, and in parallel I can work on trying to get the ff traits impl'd for the FieldElement types for k256 and p256.
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.
Cool. I'd extract the osswu method and hash2field crate to elliptic-curve.
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.
Awesome!
|
OSSWU upstreamed in PR 854 |
Signed-off-by: Michael Lodder <redmike7@gmail.com>
|
I tested this as part of opaque-ke and it works great so far, following requests:
|
|
It seems like with #503 merged this can be closed? |
Adds hash to curve according to draft v13.
For now is enabled with the
hashingfeature.