Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Issue 10170027: Implement HMAC support in lib/crypto. (Closed)

Created:
8 years, 8 months ago by Mads Ager (google)
Modified:
8 years, 7 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Implement HMAC support in lib/crypto. R=sgjesse@google.com,benl@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=7145

Patch Set 1 #

Total comments: 6

Patch Set 2 : Add missing file. #

Patch Set 3 : Address first round of review comments. #

Total comments: 4

Patch Set 4 : Address comments. #

Patch Set 5 : Update after test renaming. Added back lib testing in test.dart." #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1821 lines, -38 lines) Patch
M lib/crypto/crypto.dart View 1 2 2 chunks +52 lines, -12 lines 0 comments Download
A lib/crypto/hmac.dart View 1 2 1 chunk +55 lines, -0 lines 0 comments Download
M lib/crypto/sha1.dart View 1 2 2 chunks +6 lines, -3 lines 0 comments Download
M lib/crypto/sha256.dart View 1 2 2 chunks +6 lines, -1 line 0 comments Download
M lib/crypto/sha_utils.dart View 1 2 3 4 chunks +26 lines, -14 lines 0 comments Download
A tests/lib/crypto/hmac_sha1_test.dart View 1 2 3 4 1 chunk +27 lines, -0 lines 0 comments Download
A tests/lib/crypto/hmac_sha1_test_vectors.dart View 1 2 3 4 1 chunk +915 lines, -0 lines 0 comments Download
A tests/lib/crypto/hmac_sha256_test.dart View 1 2 3 4 1 chunk +27 lines, -0 lines 0 comments Download
A tests/lib/crypto/hmac_sha256_test_vectors.dart View 1 2 3 4 1 chunk +690 lines, -0 lines 0 comments Download
M tests/lib/crypto/sha1_test.dart View 1 2 3 4 2 chunks +8 lines, -4 lines 0 comments Download
M tests/lib/crypto/sha256_test.dart View 1 2 3 4 2 chunks +8 lines, -4 lines 0 comments Download
M tools/test.dart View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Mads Ager (google)
8 years, 8 months ago (2012-04-27 10:34:29 UTC) #1
Ben Laurie (Google)
https://chromiumcodereview.appspot.com/10170027/diff/1/lib/crypto/crypto.dart File lib/crypto/crypto.dart (right): https://chromiumcodereview.appspot.com/10170027/diff/1/lib/crypto/crypto.dart#newcode20 lib/crypto/crypto.dart:20: * called after the first call to [digest] a ...
8 years, 8 months ago (2012-04-27 13:26:33 UTC) #2
Søren Gjesse
It seems that this CL is missing the file hmac.dart referenced from crypto.dart.
8 years, 8 months ago (2012-04-27 16:46:01 UTC) #3
Mads Ager (google)
Added the missing file. Sorry about that.
8 years, 7 months ago (2012-04-30 07:13:52 UTC) #4
Mads Ager (google)
https://chromiumcodereview.appspot.com/10170027/diff/1/lib/crypto/crypto.dart File lib/crypto/crypto.dart (right): https://chromiumcodereview.appspot.com/10170027/diff/1/lib/crypto/crypto.dart#newcode20 lib/crypto/crypto.dart:20: * called after the first call to [digest] a ...
8 years, 7 months ago (2012-04-30 07:56:56 UTC) #5
Søren Gjesse
LGTM with a few suggestions https://chromiumcodereview.appspot.com/10170027/diff/8002/lib/crypto/hmac.dart File lib/crypto/hmac.dart (right): https://chromiumcodereview.appspot.com/10170027/diff/8002/lib/crypto/hmac.dart#newcode19 lib/crypto/hmac.dart:19: _hash = _hash.newInstance(); Add ...
8 years, 7 months ago (2012-04-30 09:05:23 UTC) #6
Mads Ager (google)
8 years, 7 months ago (2012-04-30 09:37:10 UTC) #7
https://chromiumcodereview.appspot.com/10170027/diff/8002/lib/crypto/hmac.dart
File lib/crypto/hmac.dart (right):

https://chromiumcodereview.appspot.com/10170027/diff/8002/lib/crypto/hmac.dar...
lib/crypto/hmac.dart:19: _hash = _hash.newInstance();
On 2012/04/30 09:05:23, Søren Gjesse wrote:
> Add and use a reset() method instead? Also as an object implementing Hash is
> passed it might be the right thing to do to call reset before using it.

We explicitly do not want to do that. The reason for not wanting to add reset is
that you can get 'dangling' references to hashes and get weird results. Avoiding
object reuse seems cleaner.

https://chromiumcodereview.appspot.com/10170027/diff/8002/lib/crypto/sha_util...
File lib/crypto/sha_utils.dart (right):

https://chromiumcodereview.appspot.com/10170027/diff/8002/lib/crypto/sha_util...
lib/crypto/sha_utils.dart:24: 'Hash update method called after digest');
On 2012/04/30 09:05:23, Søren Gjesse wrote:
> Maybe add " was retrieved" to exception text.

Done.

Powered by Google App Engine
This is Rietveld 408576698