| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 | 12 |
| 13 namespace crypto { | 13 namespace crypto { |
| 14 class SymmetricKey; | 14 class SymmetricKey; |
| 15 } // namespace crypto | 15 } // namespace crypto |
| 16 | 16 |
| 17 namespace csync { | 17 namespace syncer { |
| 18 | 18 |
| 19 // A (partial) implementation of Nigori, a protocol to securely store secrets in | 19 // A (partial) implementation of Nigori, a protocol to securely store secrets in |
| 20 // the cloud. This implementation does not support server authentication or | 20 // the cloud. This implementation does not support server authentication or |
| 21 // assisted key derivation. | 21 // assisted key derivation. |
| 22 // | 22 // |
| 23 // To store secrets securely, use the |Permute| method to derive a lookup name | 23 // To store secrets securely, use the |Permute| method to derive a lookup name |
| 24 // for your secret (basically a map key), and |Encrypt| and |Decrypt| to store | 24 // for your secret (basically a map key), and |Encrypt| and |Decrypt| to store |
| 25 // and retrieve the secret. | 25 // and retrieve the secret. |
| 26 // | 26 // |
| 27 // TODO: Link to doc. | 27 // TODO: Link to doc. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 static const size_t kUserIterations = 1002; | 74 static const size_t kUserIterations = 1002; |
| 75 static const size_t kEncryptionIterations = 1003; | 75 static const size_t kEncryptionIterations = 1003; |
| 76 static const size_t kSigningIterations = 1004; | 76 static const size_t kSigningIterations = 1004; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 scoped_ptr<crypto::SymmetricKey> user_key_; | 79 scoped_ptr<crypto::SymmetricKey> user_key_; |
| 80 scoped_ptr<crypto::SymmetricKey> encryption_key_; | 80 scoped_ptr<crypto::SymmetricKey> encryption_key_; |
| 81 scoped_ptr<crypto::SymmetricKey> mac_key_; | 81 scoped_ptr<crypto::SymmetricKey> mac_key_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace csync | 84 } // namespace syncer |
| 85 | 85 |
| 86 #endif // SYNC_UTIL_NIGORI_H_ | 86 #endif // SYNC_UTIL_NIGORI_H_ |
| OLD | NEW |