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
dsseng opened this issue Jan 18, 2020 · 9 comments
Open

x/crypto: add BLAKE3 support #36632

dsseng opened this issue Jan 18, 2020 · 9 comments
Labels
FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@dsseng
Copy link

dsseng 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
@dsseng
Copy link
Author

dsseng commented Jan 18, 2020

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

@ALTree
Copy link
Member

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
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jan 18, 2020
@dsseng
Copy link
Author

dsseng 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
Copy link
Contributor

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.

@dsseng
Copy link
Author

dsseng 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
Copy link

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

@sargun
Copy link

sargun commented Mar 25, 2021

It's been about a year since this was last discussed. Have there been any more thoughts?

@lukechampine
Copy link
Contributor

Well, I have an update on my previous comment:

It could really use an asm implementation, and perhaps being "blessed" by Google will motivate someone to contribute one.

I've since added (avo-generated) asm for AVX2 and AVX-512 myself, so performance should be at least competitive with zeebo/blake3 and the official Rust implementation (I haven't benchmarked it on a proper desktop machine yet).

@LorenzoZaccagnini

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

7 participants