Chromium Code Reviews| Index: sdk/lib/crypto/crypto.dart |
| diff --git a/sdk/lib/crypto/crypto.dart b/sdk/lib/crypto/crypto.dart |
| index 1064ca01a40e0686d092aa7d146fae629dc0fb0a..0740670413ba5ba4dd4d4f1d4b4603daa8f75eb5 100644 |
| --- a/sdk/lib/crypto/crypto.dart |
| +++ b/sdk/lib/crypto/crypto.dart |
| @@ -45,6 +45,9 @@ abstract class Hash { |
| /** |
| * Block size of the hash in bytes. |
| + * |
| + * This is exposed for use by the HMAC class which needs to know the |
| + * block size for the [Hash] it is using. |
|
Anders Johnsen
2012/11/22 11:34:33
Maybe more explicit write that it's the internal b
Mads Ager (google)
2012/11/22 11:48:38
Done.
|
| */ |
| int get blockSize; |
| } |
| @@ -95,6 +98,18 @@ abstract class HMAC { |
| * as a list of bytes. |
| */ |
| List<int> 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); |
| } |
| /** |