summaryrefslogtreecommitdiffstats
path: root/base/crypto/encryptor_mac.cc
diff options
context:
space:
mode:
authoralbertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 16:18:30 +0000
committeralbertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-31 16:18:30 +0000
commit1b47ce2e8d25023f531f4afa8f05b044c4cef111 (patch)
tree7b4875711b3b1aea46b06ad0d2bb84194d0301c7 /base/crypto/encryptor_mac.cc
parent61ee6287a14aed0235a40488394fb700e9c5c43c (diff)
downloadchromium_src-1b47ce2e8d25023f531f4afa8f05b044c4cef111.zip
chromium_src-1b47ce2e8d25023f531f4afa8f05b044c4cef111.tar.gz
chromium_src-1b47ce2e8d25023f531f4afa8f05b044c4cef111.tar.bz2
First pass of a Nigori implementation for Chrome. Only unassisted key
derivation is supported and there is no support for server authentication. BUG=37363 TEST=unit tests Review URL: http://codereview.chromium.org/1357003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/crypto/encryptor_mac.cc')
-rw-r--r--base/crypto/encryptor_mac.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/base/crypto/encryptor_mac.cc b/base/crypto/encryptor_mac.cc
index 4e8984a..e892c12 100644
--- a/base/crypto/encryptor_mac.cc
+++ b/base/crypto/encryptor_mac.cc
@@ -28,7 +28,7 @@ bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
if (iv.size() != kCCBlockSizeAES128)
return false;
- key_.reset(key);
+ key_ = key;
mode_ = mode;
iv_ = iv;
return true;
@@ -37,12 +37,12 @@ bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
bool Encryptor::Crypt(int /*CCOperation*/ op,
const std::string& input,
std::string* output) {
- DCHECK(key_.get());
+ DCHECK(key_);
CSSM_DATA raw_key = key_->cssm_data();
// CommonCryptor.h: "A general rule for the size of the output buffer which
- // must be provided by the caller is that for block ciphers, the output
+ // must be provided by the caller is that for block ciphers, the output
// length is never larger than the input length plus the block size."
-
+
size_t output_size = input.size() + iv_.size();
CCCryptorStatus err = CCCrypt(op,
kCCAlgorithmAES128,