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

Unified Diff: lib/crypto/hash_utils.dart

Issue 10388068: After bit-operation fixes the crypto library works with dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/crypto/hash_utils.dart
diff --git a/lib/crypto/hash_utils.dart b/lib/crypto/hash_utils.dart
index 0501db12b13613f4b5ee7d8a12d078de68d5edd5..f1e9d52c9404428fdccc7c8ccdc953fc5d80f2e0 100644
--- a/lib/crypto/hash_utils.dart
+++ b/lib/crypto/hash_utils.dart
@@ -132,12 +132,13 @@ class _HashBase implements Hash {
_pendingData.add(0);
}
var lengthInBits = _lengthInBytes * _BITS_PER_BYTE;
+ assert(lengthInBits < Math.pow(2, 32));
if (_bigEndianWords) {
- _pendingData.addAll(_wordToBytes(lengthInBits >> 32));
+ _pendingData.addAll(_wordToBytes(0));
_pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32));
} else {
_pendingData.addAll(_wordToBytes(lengthInBits & _MASK_32));
- _pendingData.addAll(_wordToBytes(lengthInBits >> 32));
+ _pendingData.addAll(_wordToBytes(0));
}
}
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698