-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Closes #2241: Use Keccak-256 from golang.org/x/crypto/sha3 and mention explicitly #2242
Conversation
The builds will fail until the necessary update to |
@@ -14,7 +14,6 @@ | |||
// You should have received a copy of the GNU Lesser General Public License | |||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
// Package common contains various helper functions. |
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.
This "unhelpful comment" is the Godoc synopsis of package common and should not be deleted.
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.
No problem, line preserved.
c59aaa3
to
a1fe9bc
Compare
While I certainly appreciate the effort you took to clean up the code, there are a few issues with the PR that I would like to see resolved. The main issue is that we generally avoid vendoring a patched version of a dependency with godep, because it will break as soon as someone else updates the dependencies from upstream. So far, we have treated crypto dependencies specially by vendoring them directly into our tree, for various reasons. I think it would be better to import the upstream changes into |
Yeah, that sounds right. It's a bit of a mess to vendor in Go modified libraries. I can adapt the PR easily to do that instead. |
For crypto/sha3, the last update from upstream happened in June 2015. Since then the only change has been to include the full text of the license in all files. Please make sure that they stay in place. |
For the ethash issue, I think it might be better to preserve |
Ahh, right, one more thing: the commit convention in go-ethereum is to prefix commit messages with the package they modify, e.g. "bytes: remove dead code". If you do a change affecting a lot of packages, you can use prefix "all:". The renaming of both |
Roger that, cheers. |
Thank you for contributing to go-ethereum. |
Revision: 1f22c0103821b9390939b6776727195525381532
This hash function is slightly different from the standarized NIST SHA-3 as both of them use different domain separation bits.
As we aren't really using the standarized SHA-3
a1fe9bc
to
139f6a0
Compare
@fjl thanks for the suggestions, it's way more clear now ;) |
Current coverage is
|
👍 |
Thanks for the PR @jimenezrick, appreciated. 👍 |
Closes #2241: Use Keccak-256 from golang.org/x/crypto/sha3 and mention explicitly
First of all, apologies for this long PR.
These are the improvements I propose:
golang.org/x/crypto/sha3
with a small patch to expose Keccak-256 and update the old copied code. The upstream version of sha3 is a bit faster.Before merging there are two things that need to be taken care:Thegolang.org/x/crypto
fork (with just this modification: https://github.com/jimenezrick/crypto/commit/8802e1c340c41c8d290e6315609cfbcbdf1b6229) should be hosted somewhere, it could be the Ethereum Github: something like github.com/ethereum/go-crypto - that new import path could be used insteadThe Go code in https://github.com/ethereum/ethash needs to be updated remove references to:crypto.Sha3{,Hash}()