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

Side by Side Diff: crypto/symmetric_key_win.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/symmetric_key.h" 5 #include "crypto/symmetric_key.h"
6 6
7 #include <winsock2.h> // For htonl. 7 #include <winsock2.h> // For htonl.
8 8
9 #include <vector> 9 #include <vector>
10 10
11 // TODO(wtc): replace scoped_array by std::vector. 11 // TODO(wtc): replace scoped_array by std::vector.
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 13
14 namespace base { 14 namespace crypto {
15 15
16 namespace { 16 namespace {
17 17
18 // The following is a non-public Microsoft header documented in MSDN under 18 // The following is a non-public Microsoft header documented in MSDN under
19 // CryptImportKey / CryptExportKey. Following the header is the byte array of 19 // CryptImportKey / CryptExportKey. Following the header is the byte array of
20 // the actual plaintext key. 20 // the actual plaintext key.
21 struct PlaintextBlobHeader { 21 struct PlaintextBlobHeader {
22 BLOBHEADER hdr; 22 BLOBHEADER hdr;
23 DWORD cbKeySize; 23 DWORD cbKeySize;
24 }; 24 };
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 SymmetricKey::SymmetricKey(HCRYPTPROV provider, 526 SymmetricKey::SymmetricKey(HCRYPTPROV provider,
527 HCRYPTKEY key, 527 HCRYPTKEY key,
528 const void* key_data, size_t key_size_in_bytes) 528 const void* key_data, size_t key_size_in_bytes)
529 : provider_(provider), key_(key) { 529 : provider_(provider), key_(key) {
530 if (key_data) { 530 if (key_data) {
531 raw_key_.assign(reinterpret_cast<const char*>(key_data), 531 raw_key_.assign(reinterpret_cast<const char*>(key_data),
532 key_size_in_bytes); 532 key_size_in_bytes);
533 } 533 }
534 } 534 }
535 535
536 } // namespace base 536 } // namespace crypto
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698