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
x/crypto/sha3: add Keccak 256 support #19709
Comments
I'm not a member of the Go team and this my personal opinion. @pascaldekloe Adam (@agl) once said:
I'm not sure whether it's worth to add a new keccak package - probably not. It would be basically a copy of the sha3 package - but of course @agl has to decide about this. |
Keccak256 is just very small modification (1 byte modification!) to sha3, similar to shake better to extend sha3 package, not create a new one. |
Based on discussion with @agl, @bradfitz, @ianlancetaylor, accepted with symbol name Let us know if Ethereum also uses the 128 variant. |
@FiloSottile Ethereum's Go code uses only 256 variant for reference https://github.com/ethereumproject/go-ethereum/blob/master/crypto/sha3/hashes.go |
Shall CL106462 be used to make the change or should I create a new one? |
|
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709
Change https://golang.org/cl/106462 mentions this issue: |
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709
@FiloSottile Just saw this, wow :) That said, could we also have PS: @splix The link posted above is not from the upstream Ethereum project, rather the ETC fork of it. |
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709 Change-Id: I1b45afce9b7719241b24bbdc9b67718d73b457d3 GitHub-Last-Rev: 4f2a701 GitHub-Pull-Request: golang#41 Reviewed-on: https://go-review.googlesource.com/106462 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709 Change-Id: I1b45afce9b7719241b24bbdc9b67718d73b457d3 GitHub-Last-Rev: 4f2a701c5ff0c6ee36c931794ea76bed9a98835e GitHub-Pull-Request: golang/crypto#41 Reviewed-on: https://go-review.googlesource.com/106462 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709 Change-Id: I1b45afce9b7719241b24bbdc9b67718d73b457d3 GitHub-Last-Rev: 4f2a701c5ff0c6ee36c931794ea76bed9a98835e GitHub-Pull-Request: golang/crypto#41 Reviewed-on: https://go-review.googlesource.com/106462 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709 Change-Id: I1b45afce9b7719241b24bbdc9b67718d73b457d3 GitHub-Last-Rev: 4f2a701c5ff0c6ee36c931794ea76bed9a98835e GitHub-Pull-Request: golang/crypto#41 Reviewed-on: https://go-review.googlesource.com/106462 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709 Change-Id: I1b45afce9b7719241b24bbdc9b67718d73b457d3 GitHub-Last-Rev: 4f2a701c5ff0c6ee36c931794ea76bed9a98835e GitHub-Pull-Request: golang/crypto#41 Reviewed-on: https://go-review.googlesource.com/106462 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Keccak uses a different domain separation byte as the NIST- standardized SHA-3 hashing function. Fixes golang/go#19709 Change-Id: I1b45afce9b7719241b24bbdc9b67718d73b457d3 GitHub-Last-Rev: 4f2a701 GitHub-Pull-Request: golang#41 Reviewed-on: https://go-review.googlesource.com/106462 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Ethereum and other crypto chains use the "original" Keccak hash. The difference is a dsbyte of 1 instead of 6 as in
func NewKeccak256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x01} }
.Can we support this Hash in the library or allow the specification of the domain separation byte in some way?
The text was updated successfully, but these errors were encountered: