Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(46)

Issue 5550043: code review 5550043: crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by Luit
Modified:
13 years, 4 months ago
Reviewers:
CC:
agl1, r2, rsc, r, golang-dev
Visibility:
Public.

Description

crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512 First was, apart from adding tests, a single line of code (to add the constructor function). Adding SHA512-based hashing to crypto/hmac required minor rework of the package because of a previously hardcoded block-size in it's implementation. Instead of using a hash.Hash generator function the constructor function now uses a crypto.Hash type, which was extended to expose information about block size. The only standard library package impacted by the change is crypto/tls, for which the fix is included in this patch. It might be useful to extend gofix to include this API change too.

Patch Set 1 #

Patch Set 2 : diff -r 4a8268927758 https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 3 : diff -r 4a8268927758 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 9f2cc72b8e0d https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 5 : diff -r 9f2cc72b8e0d https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+367 lines, -31 lines) Patch
M src/pkg/crypto/hmac/hmac.go View 1 2 3 4 4 chunks +13 lines, -19 lines 0 comments Download
M src/pkg/crypto/hmac/hmac_test.go View 1 2 3 4 11 chunks +300 lines, -12 lines 0 comments Download
M src/pkg/crypto/md4/md4.go View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M src/pkg/crypto/md5/md5.go View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M src/pkg/crypto/openpgp/canonical_text.go View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/pkg/crypto/openpgp/canonical_text_test.go View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/pkg/crypto/ripemd160/ripemd160.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/crypto/sha1/sha1.go View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M src/pkg/crypto/sha256/sha256.go View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M src/pkg/crypto/sha512/sha512.go View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M src/pkg/exp/ssh/transport.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/hash/adler32/adler32.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/hash/crc32/crc32.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/hash/crc64/crc64.go View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/hash/fnv/fnv.go View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/pkg/hash/hash.go View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 48
Luit
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 4 months ago (2012-01-17 22:27:24 UTC) #1
Luit
Now with CC: rsc, agl1 (sorry if you're not the right people to CC)
13 years, 4 months ago (2012-01-17 22:48:51 UTC) #2
rsc
The implication of the crypto API change is that for some crypto.Hash h, h.BlockSize() != ...
13 years, 4 months ago (2012-01-17 22:56:29 UTC) #3
Luit
I'm not sure I fully understand what you're trying to say, but for h crypto.Hash; ...
13 years, 4 months ago (2012-01-17 23:07:56 UTC) #4
agl1
> The implication of the crypto API change is that for some > crypto.Hash h, ...
13 years, 4 months ago (2012-01-17 23:08:00 UTC) #5
Luit
What do you propose to fix the nil-returning New()? http://codereview.appspot.com/5550043/diff/2001/src/pkg/crypto/hmac/hmac.go File src/pkg/crypto/hmac/hmac.go (right): http://codereview.appspot.com/5550043/diff/2001/src/pkg/crypto/hmac/hmac.go#newcode72 src/pkg/crypto/hmac/hmac.go:72: ...
13 years, 4 months ago (2012-01-17 23:15:56 UTC) #6
Luit
Hello golang-dev@googlegroups.com, agl@golang.org (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 4 months ago (2012-01-17 23:17:12 UTC) #7
Luit
http://codereview.appspot.com/5550043/diff/2001/src/pkg/crypto/crypto.go File src/pkg/crypto/crypto.go (right): http://codereview.appspot.com/5550043/diff/2001/src/pkg/crypto/crypto.go#newcode64 src/pkg/crypto/crypto.go:64: // size. It doesn't require that the hash function ...
13 years, 4 months ago (2012-01-17 23:17:45 UTC) #8
agl1
On 2012/01/17 23:15:56, Luit wrote: > What do you propose to fix the nil-returning New()? ...
13 years, 4 months ago (2012-01-17 23:18:25 UTC) #9
Luit
On 2012/01/17 23:18:25, agl1 wrote: > The NewXXX functions can't fail, which is fine. But ...
13 years, 4 months ago (2012-01-17 23:23:17 UTC) #10
agl1
On Tue, Jan 17, 2012 at 6:23 PM, <luitvd@gmail.com> wrote: > It starting to look ...
13 years, 4 months ago (2012-01-17 23:25:41 UTC) #11
r2
I need to be talked into any API changes looming. Go 1 is in the ...
13 years, 4 months ago (2012-01-17 23:26:56 UTC) #12
Luit
On 2012/01/17 23:25:41, agl1 wrote: > On Tue, Jan 17, 2012 at 6:23 PM, <mailto:luitvd@gmail.com> ...
13 years, 4 months ago (2012-01-17 23:27:51 UTC) #13
Luit
On 2012/01/17 23:26:56, r2 wrote: > I need to be talked into any API changes ...
13 years, 4 months ago (2012-01-17 23:30:44 UTC) #14
rsc
I spent a while looking at this and toying with different changes that would make ...
13 years, 4 months ago (2012-01-18 03:02:08 UTC) #15
Luit
On 2012/01/18 03:02:08, rsc wrote: > I think the simplest thing is to expand hash.Hash ...
13 years, 4 months ago (2012-01-18 08:38:11 UTC) #16
Luit
Hello golang-dev@googlegroups.com, agl@golang.org, r@google.com (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 4 months ago (2012-01-18 09:40:40 UTC) #17
Luit
Hello golang-dev@googlegroups.com, agl@golang.org, r@google.com (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 4 months ago (2012-01-18 09:41:45 UTC) #18
Luit
On 2012/01/18 09:41:45, Luit wrote: > Hello mailto:golang-dev@googlegroups.com, mailto:agl@golang.org, mailto:r@google.com (cc: > mailto:golang-dev@googlegroups.com, mailto:rsc@golang.org), > ...
13 years, 4 months ago (2012-01-18 09:43:13 UTC) #19
Luit
Hello golang-dev@googlegroups.com, agl@golang.org, r@google.com (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 4 months ago (2012-01-18 09:44:30 UTC) #20
Luit
Hello golang-dev@googlegroups.com, agl@golang.org, r@google.com (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 4 months ago (2012-01-18 09:50:15 UTC) #21
Luit
Hello golang-dev@googlegroups.com, agl@golang.org, r@google.com (cc: golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
13 years, 4 months ago (2012-01-18 10:00:04 UTC) #22
Luit
I'm done now. I'm sorry if the volume of messages in this thread bothers anyone. ...
13 years, 4 months ago (2012-01-18 10:11:16 UTC) #23
rsc
I think the changes look fine, except that I do not want to expand the ...
13 years, 4 months ago (2012-01-18 14:11:59 UTC) #24
Luit
On 2012/01/18 14:11:59, rsc wrote: > I think the changes look fine, except that I ...
13 years, 4 months ago (2012-01-18 14:20:16 UTC) #25
agl1
On Wed, Jan 18, 2012 at 9:12 AM, <rsc@golang.org> wrote: > I think the changes ...
13 years, 4 months ago (2012-01-18 14:21:25 UTC) #26
Luit
Don't really mind that as much, AGL, as I learn with every step in this. ...
13 years, 4 months ago (2012-01-18 14:28:58 UTC) #27
rsc
On Wed, Jan 18, 2012 at 09:21, Adam Langley <agl@golang.org> wrote: > I would prefer ...
13 years, 4 months ago (2012-01-18 14:34:56 UTC) #28
rsc
On Wed, Jan 18, 2012 at 09:20, <luitvd@gmail.com> wrote: > Agreed. Still, IMHO NewSHA256 then ...
13 years, 4 months ago (2012-01-18 14:38:51 UTC) #29
Luit
Because I can't write one myself I'm not sure, but I think having gofix add ...
13 years, 4 months ago (2012-01-18 14:53:42 UTC) #30
Luit
I realise it's close to Go 1, but after Go 1 it'll be impossible. Just ...
13 years, 4 months ago (2012-01-18 14:54:38 UTC) #31
rsc
On Wed, Jan 18, 2012 at 09:53, <luitvd@gmail.com> wrote: > Because I can't write one ...
13 years, 4 months ago (2012-01-18 14:56:58 UTC) #32
Luit
On 2012/01/18 14:56:58, rsc wrote: > Please delete the additional import and helpers from crypto/hmac ...
13 years, 4 months ago (2012-01-18 14:59:27 UTC) #33
rsc
On Wed, Jan 18, 2012 at 09:59, <luitvd@gmail.com> wrote: > Will do. What about SHA256? ...
13 years, 4 months ago (2012-01-18 15:00:11 UTC) #34
Luit
Hello agl@golang.org, r@google.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 4 months ago (2012-01-18 15:12:24 UTC) #35
Luit
I think this is it then. Who should be on CC for the future issue ...
13 years, 4 months ago (2012-01-18 15:21:28 UTC) #36
rsc
On Wed, Jan 18, 2012 at 10:21, <luitvd@gmail.com> wrote: > I think this is it ...
13 years, 4 months ago (2012-01-18 15:21:57 UTC) #37
r
again, API change needs to be mentioned in go 1 release notes
13 years, 4 months ago (2012-01-18 15:23:23 UTC) #38
rsc
LGTM I will send the release note change separately.
13 years, 4 months ago (2012-01-18 15:27:39 UTC) #39
Luit
On 2012/01/18 15:27:39, rsc wrote: > LGTM > > I will send the release note ...
13 years, 4 months ago (2012-01-18 15:32:24 UTC) #40
r2
On Jan 18, 2012, at 7:32 AM, luitvd@gmail.com wrote: > On 2012/01/18 15:27:39, rsc wrote: ...
13 years, 4 months ago (2012-01-18 15:35:17 UTC) #41
rsc
On Wed, Jan 18, 2012 at 10:32, <luitvd@gmail.com> wrote: > Thanks. On a related note: ...
13 years, 4 months ago (2012-01-18 15:35:45 UTC) #42
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=728321e6dbea *** crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512 First was, apart from adding ...
13 years, 4 months ago (2012-01-18 15:36:32 UTC) #43
Luit
On 2012/01/18 15:36:32, rsc wrote: > *** Submitted as http://code.google.com/p/go/source/detail?r=728321e6dbea *** > > crypto/hmac: Add ...
13 years, 4 months ago (2012-01-18 15:45:27 UTC) #44
Luit
On 2012/01/18 15:35:17, r2 wrote: > It takes a two or three minutes for me. ...
13 years, 4 months ago (2012-01-18 19:04:03 UTC) #45
r2
On Jan 18, 2012, at 11:04 AM, luitvd@gmail.com wrote: > On 2012/01/18 15:35:17, r2 wrote: ...
13 years, 4 months ago (2012-01-18 19:13:53 UTC) #46
Luit
On 2012/01/18 19:13:53, r2 wrote: > I won't argue with you, but I don't believe ...
13 years, 4 months ago (2012-01-18 19:44:49 UTC) #47
rsc
13 years, 4 months ago (2012-01-18 19:49:15 UTC) #48
all.bash does important things for the developers,
so the 2 minutes (or something like that) is probably
reasonable there.  However, you are right that all.bash
is too slow for ordinary Go users who just want to write
a Go program.  For that use case we will have binary
downloads before long.

Russ
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b