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: sha3 misleading and incorrect comment #45683

Open
nerdralph opened this issue Apr 22, 2021 · 5 comments
Open

x/crypto: sha3 misleading and incorrect comment #45683

nerdralph opened this issue Apr 22, 2021 · 5 comments
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@nerdralph
Copy link

https://github.com/golang/crypto/blob/master/sha3/sha3.go#L125

The Write function is not just used for SHAKE, it's also used for SHA-3.
The comment has a typo, it should say "after reading". I suggest the line be changed to:
// if more data is written after reading

@gopherbot gopherbot added this to the Unreleased milestone Apr 22, 2021
@gopherbot
Copy link

Change https://golang.org/cl/313169 mentions this issue: sha3: fix ShakeHash Write doc

@nerdralph
Copy link
Author

The proposed change still refers to "ShakeHash" even though the Write function is not specific to SHAKE.

@seankhliao
Copy link
Member

right, updated

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 26, 2021
@cherrymui
Copy link
Member

cc @FiloSottile

@FiloSottile
Copy link
Contributor

The comment also says produces an error, but actually it will panic. The behavior is correctly documented on ShakeHash.

https://pkg.go.dev/golang.org/x/crypto/sha3#ShakeHash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants