Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: crypto/encryptor_mac.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/crypto/encryptor.h" 5 #include "crypto/encryptor.h"
6 6
7 #include <CommonCrypto/CommonCryptor.h> 7 #include <CommonCrypto/CommonCryptor.h>
8 8
9 #include "base/crypto/symmetric_key.h"
10 #include "base/logging.h" 9 #include "base/logging.h"
11 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "crypto/symmetric_key.h"
12 12
13 namespace base { 13 namespace crypto {
14 14
15 Encryptor::Encryptor() 15 Encryptor::Encryptor()
16 : key_(NULL), 16 : key_(NULL),
17 mode_(CBC) { 17 mode_(CBC) {
18 } 18 }
19 19
20 Encryptor::~Encryptor() { 20 Encryptor::~Encryptor() {
21 } 21 }
22 22
23 bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) { 23 bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) { 68 bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
69 return Crypt(kCCEncrypt, plaintext, ciphertext); 69 return Crypt(kCCEncrypt, plaintext, ciphertext);
70 } 70 }
71 71
72 bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) { 72 bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) {
73 return Crypt(kCCDecrypt, ciphertext, plaintext); 73 return Crypt(kCCDecrypt, ciphertext, plaintext);
74 } 74 }
75 75
76 } // namespace base 76 } // namespace crypto
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698