-
Notifications
You must be signed in to change notification settings - Fork 20
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 the standard way to hash data to a curve point/scalar #35
Comments
Given that |
Status update: I suppose To recap, we need to stabilize two things:
|
Update, after a discussion with @cygnusv:
We want to preserve the compatibility with Ethereum contracts, and only 32-byte hashes are available there. We could concatenate two 32-byte hashes, like So all in all, the remainders of this issue should be fixed in #87. |
At the moment
unsafe_hash_to_point()
uses a simple ad-hoc algorithm. There is a (draft) standard for such hashing: https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-10.htmlWe also need to use the standard
hash_to_field()
to hash toScalar
(seeScalarDigest
), since there may be problems when SHA256 is used for that without the expansions (as is the case inRustCrypto
libraries now).Seems like it would be a good practice to use the standard, but the required implementation is quite bulky and needs access to some internals not currently exposed by the
RustCrypto
ECC stack we use. It would be much better if it was implemented there. Tracking issue: RustCrypto/traits#481As an alternative, we could use the reference implementation and convert its result to a
RustCrypto
object. Is it worth all the extra dependencies? (The dependencies might only be used at build time if #3 is fixed by implementing a build-stage macro).Reference implementation:
https://github.com/armfazh/redox-ecc
https://github.com/armfazh/h2c-rust-ref
The text was updated successfully, but these errors were encountered: