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

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

Issue 16624003: Remove the crypto factories (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | pkg/crypto/lib/src/hmac.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/crypto/lib/crypto.dart
diff --git a/pkg/crypto/lib/crypto.dart b/pkg/crypto/lib/crypto.dart
index dad82111f5093cc309c2a5a932f599483b7684c2..78b2642dde88be3b3c94f21d47e092a773a569a1 100644
--- a/pkg/crypto/lib/crypto.dart
+++ b/pkg/crypto/lib/crypto.dart
@@ -54,72 +54,6 @@ abstract class Hash {
}
/**
- * SHA1 hash function implementation.
- */
-class SHA1 implements Hash {
- factory SHA1() => new _SHA1();
-}
-
-/**
- * SHA256 hash function implementation.
- */
-class SHA256 implements Hash {
- factory SHA256() => new _SHA256();
-}
-
-/**
- * MD5 hash function implementation.
- *
- * WARNING: MD5 has known collisions and should only be used when
- * required for backwards compatibility.
- */
-class MD5 implements Hash {
- factory MD5() => new _MD5();
-}
-
-/**
- * Hash-based Message Authentication Code support.
- *
- * The [add] method is used to add data to the message. The [digest] and
- * [close] methods are used to extract the message authentication code.
- */
-// TODO(floitsch): make Hash implement Sink, EventSink or similar.
-class HMAC {
- /**
- * Create an [HMAC] object from a [Hash] and a key.
- */
- factory HMAC(Hash hash, List<int> key) => new _HMAC(hash, key);
-
- /**
- * Add a list of bytes to the message.
- */
- add(List<int> data);
-
- /**
- * Perform the actual computation and extract the message digest
- * as a list of bytes.
- */
- List<int> close();
-
- /**
- * Extract the message digest as a list of bytes without closing [this].
- */
- List<int> get digest;
-
- /**
- * Verify that the HMAC computed for the data so far matches the
- * given message digest.
- *
- * This method should be used instead of memcmp-style comparisons
- * to avoid leaking information via timing.
- *
- * Throws an exception if the given digest does not have the same
- * size as the digest computed by this HMAC instance.
- */
- bool verify(List<int> digest);
-}
-
-/**
* Utility methods for working with message digests.
*/
class CryptoUtils {
« no previous file with comments | « no previous file | pkg/crypto/lib/src/hmac.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698