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

Unified Diff: pkg/crypto/lib/src/hash_utils.dart

Issue 873273008: Convert crypto libraries to use Uint32Lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | « pkg/crypto/lib/crypto.dart ('k') | pkg/crypto/lib/src/md5.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/crypto/lib/src/hash_utils.dart
===================================================================
--- pkg/crypto/lib/src/hash_utils.dart (revision 43158)
+++ pkg/crypto/lib/src/hash_utils.dart (working copy)
@@ -25,8 +25,8 @@
final int _chunkSizeInWords;
final int _digestSizeInWords;
final bool _bigEndianWords;
- final List<int> _currentChunk;
- final List<int> _h;
+ final Uint32List _currentChunk;
+ final Uint32List _h;
int _lengthInBytes = 0;
List<int> _pendingData;
bool _digestCalled = false;
@@ -35,8 +35,8 @@
int digestSizeInWords,
bool this._bigEndianWords)
: _pendingData = [],
- _currentChunk = new List(chunkSizeInWords),
- _h = new List(digestSizeInWords),
+ _currentChunk = new Uint32List(chunkSizeInWords),
+ _h = new Uint32List(digestSizeInWords),
_chunkSizeInWords = chunkSizeInWords,
_digestSizeInWords = digestSizeInWords;
@@ -69,7 +69,7 @@
}
// One round of the hash computation.
- void _updateHash(List<int> m);
+ void _updateHash(Uint32List m);
// Helper methods.
int _add32(x, y) => (x + y) & _MASK_32;
@@ -103,8 +103,8 @@
}
// Convert a 32-bit word to four bytes.
- List<int> _wordToBytes(int word) {
- List<int> bytes = new List(_BYTES_PER_WORD);
+ Uint32List _wordToBytes(int word) {
+ Uint32List bytes = new Uint32List(_BYTES_PER_WORD);
bytes[0] = (word >> (_bigEndianWords ? 24 : 0)) & _MASK_8;
bytes[1] = (word >> (_bigEndianWords ? 16 : 8)) & _MASK_8;
bytes[2] = (word >> (_bigEndianWords ? 8 : 16)) & _MASK_8;
« no previous file with comments | « pkg/crypto/lib/crypto.dart ('k') | pkg/crypto/lib/src/md5.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698