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

Issue 7541045: code review 7541045: crypto/cipher: Use builtin copy instead of manually cop...

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

Description

crypto/cipher: Use builtin copy instead of manually copying values. Updated CryptBlocks method of cbcEncrypter and cbcDecrypter.

Patch Set 1 #

Patch Set 2 : diff -r 8377d19921c3 https://code.google.com/p/go #

Patch Set 3 : diff -r 969045163653 https://code.google.com/p/go #

Total comments: 2

Patch Set 4 : diff -r 95031c549c51 https://code.google.com/p/go #

Patch Set 5 : diff -r 95031c549c51 https://code.google.com/p/go #

Total comments: 6

Patch Set 6 : diff -r a1ce0637ab2b https://code.google.com/p/go #

Patch Set 7 : diff -r a1ce0637ab2b https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -6 lines) Patch
M src/pkg/crypto/cipher/cbc.go View 1 2 3 4 5 2 chunks +3 lines, -6 lines 0 comments Download
M src/pkg/crypto/cipher/cbc_aes_test.go View 1 2 3 4 5 6 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 15
fasmat
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
12 years, 7 months ago (2013-03-10 23:21:03 UTC) #1
nigeltao
This change is probably fine, but benchmark numbers would be good, and agl should probably ...
12 years, 7 months ago (2013-03-11 22:55:57 UTC) #2
agl1
https://codereview.appspot.com/7541045/diff/4001/src/pkg/crypto/cipher/cbc.go File src/pkg/crypto/cipher/cbc.go (right): https://codereview.appspot.com/7541045/diff/4001/src/pkg/crypto/cipher/cbc.go#newcode56 src/pkg/crypto/cipher/cbc.go:56: copy(dst, x.iv) This looks fine. (This code was written ...
12 years, 7 months ago (2013-03-12 14:48:33 UTC) #3
fasmat
> https://codereview.appspot.com/7541045/diff/4001/src/pkg/crypto/cipher/cbc.go#newcode88 > src/pkg/crypto/cipher/cbc.go:88: copy(dst, x.tmp) > I think this fails if dst==src. It may ...
12 years, 7 months ago (2013-03-12 14:52:13 UTC) #4
fasmat
Hello agl@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 7 months ago (2013-03-12 22:13:39 UTC) #5
agl1
https://codereview.appspot.com/7541045/diff/15001/src/pkg/crypto/cipher/cbc.go File src/pkg/crypto/cipher/cbc.go (right): https://codereview.appspot.com/7541045/diff/15001/src/pkg/crypto/cipher/cbc.go#newcode54 src/pkg/crypto/cipher/cbc.go:54: dst[i] = x.iv[i] I'm not sure why this line ...
12 years, 7 months ago (2013-03-12 22:17:57 UTC) #6
fasmat
On 2013/03/12 22:13:39, fasmat wrote: > Hello mailto:agl@golang.org (cc: mailto:golang-dev@googlegroups.com), > > Please take another ...
12 years, 7 months ago (2013-03-12 22:19:10 UTC) #7
fasmat
https://codereview.appspot.com/7541045/diff/15001/src/pkg/crypto/cipher/cbc.go File src/pkg/crypto/cipher/cbc.go (right): https://codereview.appspot.com/7541045/diff/15001/src/pkg/crypto/cipher/cbc.go#newcode54 src/pkg/crypto/cipher/cbc.go:54: dst[i] = x.iv[i] On 2013/03/12 22:17:57, agl1 wrote: > ...
12 years, 7 months ago (2013-03-12 22:37:13 UTC) #8
fasmat
https://codereview.appspot.com/7541045/diff/15001/src/pkg/crypto/cipher/cbc_aes_test.go File src/pkg/crypto/cipher/cbc_aes_test.go (right): https://codereview.appspot.com/7541045/diff/15001/src/pkg/crypto/cipher/cbc_aes_test.go#newcode100 src/pkg/crypto/cipher/cbc_aes_test.go:100: encrypter := cipher.NewCBCEncrypter(c, commonIV) On 2013/03/12 22:17:57, agl1 wrote: ...
12 years, 7 months ago (2013-03-12 22:38:20 UTC) #9
fasmat
With the new benchmark function I get similar results. The copy version of the code ...
12 years, 7 months ago (2013-03-12 22:53:09 UTC) #10
dave_cheney.net
I adjusted the size of the buffer being encrypted to 1<<20 to give more iterations, ...
12 years, 7 months ago (2013-03-12 22:58:30 UTC) #11
fasmat
> lucky(~/go/src/pkg/crypto/cipher) % ~/go/misc/benchcmp {old,new}.txt > benchmark old ns/op new ns/op delta > BenchmarkCBC_AES 13840063 ...
12 years, 7 months ago (2013-03-12 23:11:37 UTC) #12
dave_cheney.net
To be clear, I don't think this change is a bad one. But I would ...
12 years, 7 months ago (2013-03-12 23:12:45 UTC) #13
fasmat
OK, then I will start on another update to crypto/cipher, which is not related to ...
12 years, 7 months ago (2013-03-13 09:29:19 UTC) #14
rsc
11 years, 10 months ago (2013-12-18 20:14:34 UTC) #15
R=close (timed out)
Sign in to reply to this message.

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