We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
go version devel +39d4178 Wed Jul 31 05:45:43 2019 +0000 linux/amd64
Yes
go env
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/jhg/.cache/go-build" GOENV="/home/jhg/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/jhg/cfmbed/cryptofuzz/modules/golang/test/go/packages" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/jhg/cfmbed/cryptofuzz/modules/golang/test/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/jhg/cfmbed/cryptofuzz/modules/golang/test/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build882554262=/tmp/go-build -gno-record-gcc-switches"
https://play.golang.org/p/PiX7cpLO5er
c81b94933420221a7ac004a90242d8b1d3e5070d
009c1185a5c5e9fc54612808977ee8f548b2258d31
Compare:
echo -en "\x00" | openssl ripemd160
Found with Cryptofuzz https://github.com/guidovranken/cryptofuzz
The text was updated successfully, but these errors were encountered:
Thank you for this report @guidovranken!
I shall ping some cryptography experts @FiloSottile @agl @veorq to take a look.
Sorry, something went wrong.
You’re holding it wrong. Take a look at the hash.Hash docs and this playground link: https://play.golang.org/p/5JWW7P4L7lJ.
Ahh. Sorry for the false positive.
Thank you @tmthrgd!
@guidovranken in deed, you need to firstly write
h.Write([]byte("\x00"))
and then for the final checksum
h.Sum(nil)
otherwise by passing in []byte{0x00} to h.Sum you are asking it to append those bytes to the current hash and return the resulting slice
[]byte{0x00}
h.Sum
// Sum appends the current hash to b and returns the resulting slice. // It does not change the underlying hash state. Sum(b []byte) []byte
as @tmthrgd linked.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/PiX7cpLO5er
What did you expect to see?
What did you see instead?
Comments
Compare:
Found with Cryptofuzz https://github.com/guidovranken/cryptofuzz
The text was updated successfully, but these errors were encountered: