Add a method to HMAC to indicate how large a digest it produces.
Review URL: http://codereview.chromium.org/6904148
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83681 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/crypto/hmac.h b/crypto/hmac.h
index 816bf60..fcd2657 100644
--- a/crypto/hmac.h
+++ b/crypto/hmac.h
@@ -30,8 +30,13 @@
explicit HMAC(HashAlgorithm hash_alg);
~HMAC();
+ size_t DigestLength() const;
+
+ // TODO(abarth): Add a PreferredKeyLength() member function.
+
// Initializes this instance using |key| of the length |key_length|. Call Init
// only once. It returns false on the second or later calls.
+ // TODO(abarth): key_length should be a size_t.
bool Init(const unsigned char* key, int key_length);
// Initializes this instance using |key|. Call Init only once. It returns
@@ -44,6 +49,7 @@
// Calculates the HMAC for the message in |data| using the algorithm supplied
// to the constructor and the key supplied to the Init method. The HMAC is
// returned in |digest|, which has |digest_length| bytes of storage available.
+ // TODO(abarth): digest_length should be a size_t.
bool Sign(const std::string& data, unsigned char* digest, int digest_length);
// TODO(albertb): Add a Verify method.