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

proposal: x/crypto/blake2s: add New(size, key) #32417

Open
carterpy opened this issue Jun 3, 2019 · 3 comments
Open

proposal: x/crypto/blake2s: add New(size, key) #32417

carterpy opened this issue Jun 3, 2019 · 3 comments

Comments

@carterpy
Copy link

@carterpy carterpy commented Jun 3, 2019

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

$ go version 1.12.2

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 GOHOSTARCH="amd64" GOHOSTOS="linux"

What did you do?

I want to be able to export newDigest for blake2s. blake2s.New128 and blake2s.New256 are great, but I want to interface with one function that can take hash size as an input (like blake2b.New)

What did you expect to see?

I want something like blake2b.New, but for blake2s. One way to make that easy is just export blake2s.newDigest

What did you see instead?

function isn't available for export in the package

@gopherbot gopherbot added this to the Unreleased milestone Jun 3, 2019
@agnivade agnivade changed the title x/crypto export blake2s.newDigest() proposal: x/crypto: export blake2s.newDigest() Jun 4, 2019
@gopherbot gopherbot added the Proposal label Jun 4, 2019
@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Jun 4, 2019

@FiloSottile FiloSottile changed the title proposal: x/crypto: export blake2s.newDigest() proposal: x/crypto/blake2s: add New(size, key) Jun 4, 2019
@carterpy

This comment has been minimized.

Copy link
Author

@carterpy carterpy commented Jun 6, 2019

@FiloSottile, saw your tweet here

How does this issue request fall wrt to your perspectives on security v safety of golang standard crypto lib? Should we close this issue because it perhaps asks for something unsafe?

@FiloSottile

This comment has been minimized.

Copy link
Member

@FiloSottile FiloSottile commented Jun 6, 2019

With the right minimums, it can be safe, but any new API adds confusion. I guess it matter whether you need a non-128-or-256 size for compatibility (in which case, with what?), or you'd just like an API that provides both. The former is a stronger case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.