OLD | NEW |
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'); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 /** | 76 /** |
77 * Hash-based Message Authentication Code support. | 77 * Hash-based Message Authentication Code support. |
78 * | 78 * |
79 * The [update] method is used to add data to the message. The [digest] method | 79 * The [update] method is used to add data to the message. The [digest] method |
80 * is used to extract the message authentication code. | 80 * is used to extract the message authentication code. |
81 */ | 81 */ |
82 abstract class HMAC { | 82 abstract class HMAC { |
83 /** | 83 /** |
84 * Create an [HMAC] object from a [Hash] and a key. | 84 * Create an [HMAC] object from a [Hash] and a key. |
85 */ | 85 */ |
86 factory HMAC(Hash hash, List<int> key) => new _HMAC(); | 86 factory HMAC(Hash hash, List<int> key) => new _HMAC(hash, key); |
87 | 87 |
88 /** | 88 /** |
89 * Add a list of bytes to the message. | 89 * Add a list of bytes to the message. |
90 */ | 90 */ |
91 HMAC update(List<int> data); | 91 HMAC update(List<int> data); |
92 | 92 |
93 /** | 93 /** |
94 * Perform the actual computation and extract the message digest | 94 * Perform the actual computation and extract the message digest |
95 * as a list of bytes. | 95 * as a list of bytes. |
96 */ | 96 */ |
(...skipping 25 matching lines...) Expand all Loading... |
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 |
OLD | NEW |