Index: crypto/hmac.h |
diff --git a/crypto/hmac.h b/crypto/hmac.h |
index 98002761e0a26d695d70ddac4de22e9c28e5bb95..a8956ff52b959d0a27e8c52bc5674a91807f5a56 100644 |
--- a/crypto/hmac.h |
+++ b/crypto/hmac.h |
@@ -54,7 +54,15 @@ class CRYPTO_API HMAC { |
bool Sign(const base::StringPiece& data, unsigned char* digest, |
int digest_length) const; |
- // TODO(albertb): Add a Verify method. |
+ // Verifies that the HMAC for the message in |data| equals the HMAC provided |
+ // in |digest|, using the algorithm supplied to the constructor and the key |
+ // supplied to the Init method. Use of this method is strongly recommended |
+ // over using Sign() with a manual comparison (such as memcmp), as such |
+ // comparisons may result in side-channel disclosures, such as timing, that |
+ // undermine the cryptographic integrity. This method does not support |
+ // comparing truncated HMACs. |
+ bool Verify(const base::StringPiece& data, |
+ const base::StringPiece& digest) const; |
private: |
HashAlgorithm hash_alg_; |