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

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

Issue 1348823004: test large inputs for sha1 and sha256, also remove unused import (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: tweaks from review 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 | « no previous file | test/sha1_test.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 library crypto.hash_base; 5 library crypto.hash_base;
6 6
7 import 'dart:math' as math;
8 import 'dart:typed_data'; 7 import 'dart:typed_data';
9 8
10 import 'hash.dart'; 9 import 'hash.dart';
11 import 'utils.dart'; 10 import 'utils.dart';
12 11
13 /// A base class for [Hash] implementations. 12 /// A base class for [Hash] implementations.
14 /// 13 ///
15 /// Subclasses should override [updateHash], and define it to update [h] with 14 /// Subclasses should override [updateHash], and define it to update [h] with
16 /// the results of the hash function. 15 /// the results of the hash function.
17 abstract class HashBase implements Hash { 16 abstract class HashBase implements Hash {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 _pendingData.addAll(_wordToBytes(lengthInBits & MASK_32)); 166 _pendingData.addAll(_wordToBytes(lengthInBits & MASK_32));
168 } else { 167 } else {
169 _pendingData.addAll(_wordToBytes(lengthInBits & MASK_32)); 168 _pendingData.addAll(_wordToBytes(lengthInBits & MASK_32));
170 _pendingData.addAll(_wordToBytes((lengthInBits >> 32) & MASK_32)); 169 _pendingData.addAll(_wordToBytes((lengthInBits >> 32) & MASK_32));
171 } 170 }
172 } 171 }
173 172
174 /// Rounds [val] to the nearest multiple of [n]. 173 /// Rounds [val] to the nearest multiple of [n].
175 int _roundUp(val, n) => (val + n - 1) & -n; 174 int _roundUp(val, n) => (val + n - 1) & -n;
176 } 175 }
OLDNEW
« no previous file with comments | « no previous file | test/sha1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698