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

Unified Diff: lib/crypto/sha1.dart

Issue 10170027: Implement HMAC support in lib/crypto. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update after test renaming. Added back lib testing in test.dart." 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
« no previous file with comments | « lib/crypto/hmac.dart ('k') | lib/crypto/sha256.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/crypto/sha1.dart
diff --git a/lib/crypto/sha1.dart b/lib/crypto/sha1.dart
index 72f57da59bc600a10f64697dfba3c5db9649f82f..cc0d198715ade81b8d95497f1321e59210c2b891 100644
--- a/lib/crypto/sha1.dart
+++ b/lib/crypto/sha1.dart
@@ -3,11 +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 _SHACryptoHashBase implements SHA1 {
+class _SHA1 extends _SHAHashBase implements SHA1 {
// Construct a SHA1 hasher object.
_SHA1() : _w = new List(80), super(16, 5) {
- // Initial value of the hash parts. First 32 bits of the fractional parts
- // of the square roots of the first 8 prime numbers.
_h[0] = 0x67452301;
_h[1] = 0xEFCDAB89;
_h[2] = 0x98BADCFE;
@@ -15,6 +13,11 @@ class _SHA1 extends _SHACryptoHashBase implements SHA1 {
_h[4] = 0xC3D2E1F0;
}
+ // Returns a new instance of this Hash.
+ SHA1 newInstance() {
+ return new SHA1();
+ }
+
// Rotate left limiting to unsigned 32-bit values.
int _rotl32(int val, int shift) {
var mod_shift = shift & 31;
« no previous file with comments | « lib/crypto/hmac.dart ('k') | lib/crypto/sha256.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698