OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef SYNC_UTIL_NIGORI_H_ | 5 #ifndef SYNC_UTIL_NIGORI_H_ |
6 #define SYNC_UTIL_NIGORI_H_ | 6 #define SYNC_UTIL_NIGORI_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "sync/base/sync_export.h" | 13 #include "sync/base/sync_export.h" |
14 | 14 |
15 namespace crypto { | 15 namespace crypto { |
16 class SymmetricKey; | 16 class SymmetricKey; |
17 } // namespace crypto | 17 } // namespace crypto |
18 | 18 |
19 namespace syncer { | 19 namespace syncer { |
20 | 20 |
21 // A (partial) implementation of Nigori, a protocol to securely store secrets in | 21 // A (partial) implementation of Nigori, a protocol to securely store secrets in |
22 // the cloud. This implementation does not support server authentication or | 22 // the cloud. This implementation does not support server authentication or |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 static const size_t kDerivedKeySizeInBits = 128; | 71 static const size_t kDerivedKeySizeInBits = 128; |
72 static const size_t kIvSize = 16; | 72 static const size_t kIvSize = 16; |
73 static const size_t kHashSize = 32; | 73 static const size_t kHashSize = 32; |
74 | 74 |
75 static const size_t kSaltIterations = 1001; | 75 static const size_t kSaltIterations = 1001; |
76 static const size_t kUserIterations = 1002; | 76 static const size_t kUserIterations = 1002; |
77 static const size_t kEncryptionIterations = 1003; | 77 static const size_t kEncryptionIterations = 1003; |
78 static const size_t kSigningIterations = 1004; | 78 static const size_t kSigningIterations = 1004; |
79 | 79 |
80 private: | 80 private: |
81 scoped_ptr<crypto::SymmetricKey> user_key_; | 81 std::unique_ptr<crypto::SymmetricKey> user_key_; |
82 scoped_ptr<crypto::SymmetricKey> encryption_key_; | 82 std::unique_ptr<crypto::SymmetricKey> encryption_key_; |
83 scoped_ptr<crypto::SymmetricKey> mac_key_; | 83 std::unique_ptr<crypto::SymmetricKey> mac_key_; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace syncer | 86 } // namespace syncer |
87 | 87 |
88 #endif // SYNC_UTIL_NIGORI_H_ | 88 #endif // SYNC_UTIL_NIGORI_H_ |
OLD | NEW |