Skip to content
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: add BLAKE3 support #36632

Open
sh7dm opened this issue Jan 18, 2020 · 6 comments
Open

x/crypto: add BLAKE3 support #36632

sh7dm opened this issue Jan 18, 2020 · 6 comments

Comments

@sh7dm
Copy link

@sh7dm sh7dm commented Jan 18, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13.5 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/sh7dm/.cache/go-build"
GOENV="/home/sh7dm/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/sh7dm/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build981542473=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I found a new cryptographical hash function named BLAKE3:
https://github.com/BLAKE3-team/BLAKE3
It also has Go implementation:
https://github.com/lukechampine/blake3

What did you expect to see?

BLAKE3 support in Go

What did you see instead?

No BLAKE3 support in Go

@gopherbot gopherbot added this to the Unreleased milestone Jan 18, 2020
@sh7dm

This comment has been minimized.

Copy link
Author

@sh7dm sh7dm commented Jan 18, 2020

I can integrate https://github.com/lukechampine/blake3 in x/crypto

@ALTree

This comment has been minimized.

Copy link
Member

@ALTree ALTree commented Jan 18, 2020

Hi,

No BLAKE3 support in Go

There is support for BLAKE3 in Go. It's here: https://github.com/lukechampine/blake3 . You can download the library using go get and use it in your projects.

I can integrate https://github.com/lukechampine/blake3 in x/crypto

I don't think you can, unless the code author(s) sign the CLA and agree to re-license the code (it's MIT, I don't know if it's compatible with Go's BSD licence). In any case it's not as simple as "copy the code in lukechampine/blake3, and paste it in x/crypto".

What you are asking is for a (semi)-officially supported BLAKE3 implementation in x/crypto. This is a fair request, but someone will have to do the work and maintain the code in the future. Is not as simple as dumping another implementation in x/crypto and leaving it there.

@ALTree ALTree changed the title x/crypto: BLAKE3 support x/crypto: add BLAKE3 support Jan 18, 2020
@sh7dm

This comment has been minimized.

Copy link
Author

@sh7dm sh7dm commented Jan 18, 2020

Sure, all of this should be allowed by owner of repo, but we can just import and export the module from x/crypto

@lukechampine

This comment has been minimized.

Copy link
Contributor

@lukechampine lukechampine commented Feb 4, 2020

I'd be happy to transfer my package over to x/crypto. It could really use an asm implementation, and perhaps being "blessed" by Google will motivate someone to contribute one. However, BLAKE3 is very new -- AFAIK, no one has published a proper cryptanalysis or an attack yet. So we probably want to wait for more scrutiny before adding it.

@sh7dm

This comment has been minimized.

Copy link
Author

@sh7dm sh7dm commented Feb 4, 2020

Oh, hello! I vote for adding it now, but of course it's for the decision on Go developers. I'm really happy that you're interested in improving standard libs too!

@oconnor663

This comment has been minimized.

Copy link

@oconnor663 oconnor663 commented Feb 12, 2020

https://github.com/zeebo/blake3 was published recently under CC0, with optimized AVX2 and SSE4.1 implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.