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

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

Issue 1350913002: Run the formatter over crypto. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Fix a missing value. 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
« no previous file with comments | « lib/src/crypto_utils.dart ('k') | lib/src/hmac.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of crypto;
6 6
7 // Constants. 7 // Constants.
8 const _MASK_8 = 0xff; 8 const _MASK_8 = 0xff;
9 const _MASK_32 = 0xffffffff; 9 const _MASK_32 = 0xffffffff;
10 const _BITS_PER_BYTE = 8; 10 const _BITS_PER_BYTE = 8;
(...skipping 13 matching lines...) Expand all
24 abstract class _HashBase implements Hash { 24 abstract class _HashBase implements Hash {
25 final int _chunkSizeInWords; 25 final int _chunkSizeInWords;
26 final int _digestSizeInWords; 26 final int _digestSizeInWords;
27 final bool _bigEndianWords; 27 final bool _bigEndianWords;
28 final Uint32List _currentChunk; 28 final Uint32List _currentChunk;
29 final Uint32List _h; 29 final Uint32List _h;
30 int _lengthInBytes = 0; 30 int _lengthInBytes = 0;
31 List<int> _pendingData; 31 List<int> _pendingData;
32 bool _digestCalled = false; 32 bool _digestCalled = false;
33 33
34 _HashBase(int chunkSizeInWords, 34 _HashBase(
35 int digestSizeInWords, 35 int chunkSizeInWords, int digestSizeInWords, bool this._bigEndianWords)
36 bool this._bigEndianWords)
37 : _pendingData = [], 36 : _pendingData = [],
38 _currentChunk = new Uint32List(chunkSizeInWords), 37 _currentChunk = new Uint32List(chunkSizeInWords),
39 _h = new Uint32List(digestSizeInWords), 38 _h = new Uint32List(digestSizeInWords),
40 _chunkSizeInWords = chunkSizeInWords, 39 _chunkSizeInWords = chunkSizeInWords,
41 _digestSizeInWords = digestSizeInWords; 40 _digestSizeInWords = digestSizeInWords;
42 41
43 // Update the hasher with more data. 42 // Update the hasher with more data.
44 void add(List<int> data) { 43 void add(List<int> data) {
45 if (_digestCalled) { 44 if (_digestCalled) {
46 throw new StateError( 45 throw new StateError(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 assert(lengthInBits < pow(2, 32)); 141 assert(lengthInBits < pow(2, 32));
143 if (_bigEndianWords) { 142 if (_bigEndianWords) {
144 _pendingData.addAll(_wordToBytes(0)); 143 _pendingData.addAll(_wordToBytes(0));
145 _pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32)); 144 _pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32));
146 } else { 145 } else {
147 _pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32)); 146 _pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32));
148 _pendingData.addAll(_wordToBytes(0)); 147 _pendingData.addAll(_wordToBytes(0));
149 } 148 }
150 } 149 }
151 } 150 }
OLDNEW
« no previous file with comments | « lib/src/crypto_utils.dart ('k') | lib/src/hmac.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698