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

Unified Diff: lib/crypto/sha1.dart

Issue 10351008: Implement md5 hash in crypto library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reuploading Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: lib/crypto/sha1.dart
diff --git a/lib/crypto/sha1.dart b/lib/crypto/sha1.dart
index cc0d198715ade81b8d95497f1321e59210c2b891..41e66369056f5f11961fadc5a53a14c5cd650de8 100644
--- a/lib/crypto/sha1.dart
+++ b/lib/crypto/sha1.dart
@@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
// The SHA1 hasher is used to compute an SHA1 message digest.
-class _SHA1 extends _SHAHashBase implements SHA1 {
+class _SHA1 extends _HashBase implements SHA1 {
// Construct a SHA1 hasher object.
- _SHA1() : _w = new List(80), super(16, 5) {
+ _SHA1() : _w = new List(80), super(16, 5, true) {
_h[0] = 0x67452301;
_h[1] = 0xEFCDAB89;
_h[2] = 0x98BADCFE;
@@ -18,13 +18,6 @@ class _SHA1 extends _SHAHashBase implements SHA1 {
return new SHA1();
}
- // Rotate left limiting to unsigned 32-bit values.
- int _rotl32(int val, int shift) {
- var mod_shift = shift & 31;
- return ((val << mod_shift) & _MASK_32) |
- ((val & _MASK_32) >> (32 - mod_shift));
- }
-
// Compute one iteration of the SHA1 algorithm with a chunk of
// 16 32-bit pieces.
void _updateHash(List<int> m) {
« lib/crypto/hash_utils.dart ('K') | « lib/crypto/md5.dart ('k') | lib/crypto/sha256.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698