-
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
Possibly reduce the amount of hash functions used in the code #2
Comments
Absolutely we can do this. Problematically, there's some places we may need to keep as keccak or sha256 to ensure compatibility with Ethereum, but that needs re-scoping. I'm going to add the scoping label to this and leave the actionable item in this issue to identify which hash function calls are required for compatibility. Be aware that we should likely also update pyUmbral at the same time, and subsequently release on nucypher to ensure compatibility. I'd put this at a relatively high priority should we want these changes before a mainnet release. |
After I spent so much time finding a useable and compatible blake2b library for JS 😢😢😢😢 |
From the discussion: use SHA-256 everywhere. Seems like |
To be clear, we will use SHA-256 "everywhere", but in some cases we can't use it directly; for example, when hashing to a scalar, where we will use a more complex construction which internally uses SHA256 (but no other hashing function). After reading the security discussion in the hash-to-curve standard, it's clear that SHA256 alone could introduce a small bias when used modulo For the particular case of hashing to a scalar, we need to use the So, in essence, every time that we were using |
Hm, I'm confused here. What was If I understand the implementation of
The only difference I noticed is that it is guaranteed to return a non-zero value. Is that important? |
In the Python implementation we have, in different places, SHA256, Blake2b and Keccak. In this implementation some occurrences of Blake2b are replaced with SHA3 temporarily because of digest length requirements (e.g. in
hash_to_scalar()
). Could we use a single hash function everywhere?The text was updated successfully, but these errors were encountered: