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

Issue 4315050: code review 4315050: crypto/des: cleanups (Closed)

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

Description

crypto/des: cleanups

Patch Set 1 #

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

Total comments: 8

Patch Set 3 : diff -r 1d152ae12dfc https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -356 lines) Patch
M src/pkg/Makefile View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/crypto/des/block.go View 1 2 3 chunks +41 lines, -73 lines 0 comments Download
M src/pkg/crypto/des/cipher.go View 1 4 chunks +19 lines, -29 lines 0 comments Download
M src/pkg/crypto/des/const.go View 1 2 1 chunk +99 lines, -98 lines 0 comments Download
M src/pkg/crypto/des/des_test.go View 1 2 15 chunks +58 lines, -156 lines 0 comments Download

Messages

Total messages: 4
agl1
Please be nit-picky, might as well do this in one.
13 years, 11 months ago (2011-04-05 18:22:53 UTC) #1
rsc
LGTM http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/block.go File src/pkg/crypto/des/block.go (right): http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/block.go#newcode61 src/pkg/crypto/des/block.go:61: block |= bit << uint64((len(permutation)-1)-position) s/uint64/uint/ The shift ...
13 years, 11 months ago (2011-04-05 19:16:11 UTC) #2
agl1
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-04-05 19:40:47 UTC) #3
agl1
13 years, 11 months ago (2011-04-05 19:40:56 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=b11e62f75948 ***

crypto/des: cleanups

R=rsc
CC=golang-dev
http://codereview.appspot.com/4315050

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/block.go
File src/pkg/crypto/des/block.go (right):

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/block.go#n...
src/pkg/crypto/des/block.go:61: block |= bit <<
uint64((len(permutation)-1)-position)
On 2011/04/05 19:16:11, rsc wrote:
> s/uint64/uint/
> 
> The shift just needs an unsigned right arg, it doesn't
> have to be the same type as the left.  On a 32-bit machine
> the uint shift will be a little easier to implement.

Done.

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/block.go#n...
src/pkg/crypto/des/block.go:73: left := (last << (4 + uint32(ksRotations[i])))
>> 4
On 2011/04/05 19:16:11, rsc wrote:
> can drop uint32 conversion

Done.

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/const.go
File src/pkg/crypto/des/const.go (right):

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/const.go#n...
src/pkg/crypto/des/const.go:82: [16]uint8{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6,
12, 5, 9, 0, 7},
On 2011/04/05 19:16:11, rsc wrote:
> Can drop all these [16]uint8

Done.

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/des_test.go
File src/pkg/crypto/des/des_test.go (right):

http://codereview.appspot.com/4315050/diff/2001/src/pkg/crypto/des/des_test.g...
src/pkg/crypto/des/des_test.go:1277: for j, v := range result {
On 2011/04/05 19:16:11, rsc wrote:
> Please replace all these loops with
> 
> if !bytes.Equal(x, y) {
>     t.Errorf("#%d: result=%x want %x", i, x, y)
> }

Done.
Sign in to reply to this message.

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