-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto/hmac: panic if reusing hash.Hash values
Also put Reset in the correct place for the other benchmarks. name old time/op new time/op delta NewWriteSum-8 1.01µs ± 0% 1.01µs ± 1% ~ (p=0.945 n=9+9) name old speed new speed delta NewWriteSum-8 31.7MB/s ± 0% 31.6MB/s ± 1% ~ (p=0.948 n=9+9) name old alloc/op new alloc/op delta NewWriteSum-8 544B ± 0% 544B ± 0% ~ (all equal) name old allocs/op new allocs/op delta NewWriteSum-8 7.00 ± 0% 7.00 ± 0% ~ (all equal) Fixes #41089 Change-Id: I3dae660adbe4993963130bf3c2636bd53899164b Reviewed-on: https://go-review.googlesource.com/c/go/+/261960 Trust: Katie Hockman <[email protected]> Trust: Roland Shoemaker <[email protected]> Run-TryBot: Katie Hockman <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
- Loading branch information
1 parent
19f6422
commit 2a206c7
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2a206c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask what this was for? It broke my key generation, and I am not sure what to do.
2a206c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use GitHub for code review, and very few people see comments on GitHub commits. Please ask your question on the golang-nuts mailing list, or, if appropriate, on https://golang.org/cl/261960.
2a206c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @ianlancetaylor's suggestion.
But, since I happened to see it, I can provide a bit of clarity. First, please read over the details in #41089 which describes the motivation for the change.
If it broke your key generation, then that likely means that your hash function wasn't producing unique outputs, and should be updated.
So rather than this:
You can either do this:
Or more simply, this:
2a206c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you! I think my actual key generation happens in Cosmos SDK code that I don't control, but I'm also way behind on that SDK, and upgrading now, so hopefully this issue will go away.