summaryrefslogtreecommitdiffstats
path: root/crypto/hmac.h
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-30 18:55:18 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-30 18:55:18 +0000
commita5aec2ed627f15f6696113109085f02b0c2c8bae (patch)
tree1e380d792cee1c3c7409e343200d0864606334d2 /crypto/hmac.h
parent555e067bcbccbe3b6131ce9e0569e41defabf290 (diff)
downloadchromium_src-a5aec2ed627f15f6696113109085f02b0c2c8bae.zip
chromium_src-a5aec2ed627f15f6696113109085f02b0c2c8bae.tar.gz
chromium_src-a5aec2ed627f15f6696113109085f02b0c2c8bae.tar.bz2
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
Diffstat (limited to 'crypto/hmac.h')
-rw-r--r--crypto/hmac.h6
1 files changed, 6 insertions, 0 deletions
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 @@ class HMAC {
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 @@ class HMAC {
// 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.