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

Unified Diff: sdk/lib/crypto/hash_utils.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/crypto/crypto.dart ('k') | sdk/lib/crypto/hmac.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/crypto/hash_utils.dart
diff --git a/sdk/lib/crypto/hash_utils.dart b/sdk/lib/crypto/hash_utils.dart
index 81dcd68279435738c6a232066a7b87e5ec48e99c..ed42140f385cbe5ba343da63d46364ebf6d375b8 100644
--- a/sdk/lib/crypto/hash_utils.dart
+++ b/sdk/lib/crypto/hash_utils.dart
@@ -26,12 +26,12 @@ abstract class _HashBase implements Hash {
int this._digestSizeInWords,
bool this._bigEndianWords)
: _pendingData = [] {
- _currentChunk = new List(_chunkSizeInWords);
- _h = new List(_digestSizeInWords);
+ _currentChunk = new List.fixedLength(_chunkSizeInWords);
+ _h = new List.fixedLength(_digestSizeInWords);
}
// Update the hasher with more data.
- _HashBase update(List<int> data) {
+ add(List<int> data) {
if (_digestCalled) {
throw new HashException(
'Hash update method called after digest was retrieved');
@@ -39,11 +39,10 @@ abstract class _HashBase implements Hash {
_lengthInBytes += data.length;
_pendingData.addAll(data);
_iterate();
- return this;
}
// Finish the hash computation and return the digest string.
- List<int> digest() {
+ List<int> close() {
if (_digestCalled) {
return _resultAsBytes();
}
@@ -98,7 +97,7 @@ abstract class _HashBase implements Hash {
// Convert a 32-bit word to four bytes.
_wordToBytes(int word) {
- List<int> bytes = new List(_BYTES_PER_WORD);
+ List<int> bytes = new List.fixedLength(_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 | « sdk/lib/crypto/crypto.dart ('k') | sdk/lib/crypto/hmac.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698