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

Side by Side Diff: lib/src/hmac.dart

Issue 1350933002: Stop using parts. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of crypto; 5 library crypto.hmac;
6
7 import 'hash.dart';
6 8
7 /** 9 /**
8 * Hash-based Message Authentication Code support. 10 * Hash-based Message Authentication Code support.
9 * 11 *
10 * The [add] method is used to add data to the message. The [digest] and 12 * The [add] method is used to add data to the message. The [digest] and
11 * [close] methods are used to extract the message authentication code. 13 * [close] methods are used to extract the message authentication code.
12 */ 14 */
13 // TODO(floitsch): make Hash implement Sink, EventSink or similar. 15 // TODO(floitsch): make Hash implement Sink, EventSink or similar.
14 class HMAC { 16 class HMAC {
15 final List<int> _message; 17 final List<int> _message;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 'Invalid digest size: ${digest.length} in HMAC.verify. ' 105 'Invalid digest size: ${digest.length} in HMAC.verify. '
104 'Expected: ${_hash.blockSize}.'); 106 'Expected: ${_hash.blockSize}.');
105 } 107 }
106 int result = 0; 108 int result = 0;
107 for (var i = 0; i < digest.length; i++) { 109 for (var i = 0; i < digest.length; i++) {
108 result |= digest[i] ^ computedDigest[i]; 110 result |= digest[i] ^ computedDigest[i];
109 } 111 }
110 return result == 0; 112 return result == 0;
111 } 113 }
112 } 114 }
OLDNEW
« lib/src/hash_base.dart ('K') | « lib/src/hash_utils.dart ('k') | lib/src/md5.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698