summaryrefslogtreecommitdiffstats
path: root/crypto/encryptor_win.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-08 02:53:09 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-08 02:53:09 +0000
commit44a016a843efffc53256c862c792e53d7909c802 (patch)
tree57a31ad697342085bbdb29b2f9bcd3e5f5d58cce /crypto/encryptor_win.cc
parent98bc449977534905d2254d76686249e18603819e (diff)
downloadchromium_src-44a016a843efffc53256c862c792e53d7909c802.zip
chromium_src-44a016a843efffc53256c862c792e53d7909c802.tar.gz
chromium_src-44a016a843efffc53256c862c792e53d7909c802.tar.bz2
Use base::StringPiece for input parameters in Encryptor, rather than std::string
R=wtc BUG=none TEST=crypto_unittests Review URL: http://codereview.chromium.org/7230037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/encryptor_win.cc')
-rw-r--r--crypto/encryptor_win.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/encryptor_win.cc b/crypto/encryptor_win.cc
index 8bbd6b8..088c9e5 100644
--- a/crypto/encryptor_win.cc
+++ b/crypto/encryptor_win.cc
@@ -37,7 +37,9 @@ Encryptor::Encryptor()
Encryptor::~Encryptor() {
}
-bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
+bool Encryptor::Init(SymmetricKey* key,
+ Mode mode,
+ const base::StringPiece& iv) {
DCHECK(key);
DCHECK_EQ(CBC, mode) << "Unsupported mode of operation";
@@ -77,7 +79,8 @@ bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
return true;
}
-bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
+bool Encryptor::Encrypt(const base::StringPiece& plaintext,
+ std::string* ciphertext) {
DWORD data_len = plaintext.size();
DWORD total_len = data_len + block_size_;
@@ -94,7 +97,8 @@ bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
return true;
}
-bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) {
+bool Encryptor::Decrypt(const base::StringPiece& ciphertext,
+ std::string* plaintext) {
DWORD data_len = ciphertext.size();
if (data_len == 0)
return false;