summaryrefslogtreecommitdiffstats
path: root/crypto/hmac_nss.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 22:00:11 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 22:00:11 +0000
commitc28986ee4a9bcd79297e5f96178c908627e8f395 (patch)
treeda00b64efae510c655ccc4fd285e1d778d645df8 /crypto/hmac_nss.cc
parent083072ff2d098c5bed10032f240655e372e125f1 (diff)
downloadchromium_src-c28986ee4a9bcd79297e5f96178c908627e8f395.zip
chromium_src-c28986ee4a9bcd79297e5f96178c908627e8f395.tar.gz
chromium_src-c28986ee4a9bcd79297e5f96178c908627e8f395.tar.bz2
Change HMAC::Sign() to take base::StringPiece instead of string.
Do this to avoid memory copying when signning data in char*. base::StringPiece nicely handles both cases. BUG=None TEST=crypto_unittests Review URL: http://codereview.chromium.org/7033035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/hmac_nss.cc')
-rw-r--r--crypto/hmac_nss.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/hmac_nss.cc b/crypto/hmac_nss.cc
index 722fcf1..81b2e39 100644
--- a/crypto/hmac_nss.cc
+++ b/crypto/hmac_nss.cc
@@ -73,7 +73,7 @@ bool HMAC::Init(const unsigned char *key, int key_length) {
return true;
}
-bool HMAC::Sign(const std::string& data,
+bool HMAC::Sign(const base::StringPiece& data,
unsigned char* digest,
int digest_length) const {
if (!plat_->sym_key_.get()) {