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

Side by Side Diff: lib/crypto/crypto.dart

Issue 10928139: Changed interfaces to abstract classes where possible in {lib,samples,pkg} (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/isolate/base.dart » ('j') | lib/utf/utf_core.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('dart:crypto'); 5 #library('dart:crypto');
6 6
7 #import('dart:math'); 7 #import('dart:math');
8 8
9 #source('crypto_utils.dart'); 9 #source('crypto_utils.dart');
10 #source('hash_utils.dart'); 10 #source('hash_utils.dart');
11 #source('hmac.dart'); 11 #source('hmac.dart');
12 #source('md5.dart'); 12 #source('md5.dart');
13 #source('sha1.dart'); 13 #source('sha1.dart');
14 #source('sha256.dart'); 14 #source('sha256.dart');
15 15
16 /** 16 /**
17 * Interface for cryptographic hash functions. 17 * Interface for cryptographic hash functions.
18 * 18 *
19 * The [update] method is used to add data to the hash. The [digest] method 19 * The [update] method is used to add data to the hash. The [digest] method
20 * is used to extract the message digest. 20 * is used to extract the message digest.
21 * 21 *
22 * Once the [digest] method has been called no more data can be added using the 22 * Once the [digest] method has been called no more data can be added using the
23 * [update] method. If [update] is called after the first call to [digest] a 23 * [update] method. If [update] is called after the first call to [digest] a
24 * HashException is thrown. 24 * HashException is thrown.
25 * 25 *
26 * If multiple instances of a given Hash is needed the [newInstance] 26 * If multiple instances of a given Hash is needed the [newInstance]
27 * method can provide a new instance. 27 * method can provide a new instance.
28 */ 28 */
29 interface Hash { 29 abstract class Hash {
30 /** 30 /**
31 * Add a list of bytes to the hash computation. 31 * Add a list of bytes to the hash computation.
32 */ 32 */
33 Hash update(List<int> data); 33 Hash update(List<int> data);
34 34
35 /** 35 /**
36 * Finish the hash computation and extract the message digest as 36 * Finish the hash computation and extract the message digest as
37 * a list of bytes. 37 * a list of bytes.
38 */ 38 */
39 List<int> digest(); 39 List<int> digest();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 /** 122 /**
123 * HashExceptions are thrown on invalid use of a Hash 123 * HashExceptions are thrown on invalid use of a Hash
124 * object. 124 * object.
125 */ 125 */
126 class HashException { 126 class HashException {
127 HashException(String this.message); 127 HashException(String this.message);
128 toString() => "HashException: $message"; 128 toString() => "HashException: $message";
129 String message; 129 String message;
130 } 130 }
131 131
OLDNEW
« no previous file with comments | « no previous file | lib/isolate/base.dart » ('j') | lib/utf/utf_core.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698