OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_ | 5 #ifndef COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_ |
6 #define COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_ | 6 #define COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | |
10 | |
11 #include "components/cryptauth/eid_data_with_timestamp.h" | |
9 | 12 |
10 namespace cryptauth { | 13 namespace cryptauth { |
11 | 14 |
12 // Generates raw ephemeral ID (EID) values that are used by the | 15 // Generates raw ephemeral ID (EID) values that are used by the |
13 // ForegroundEidGenerator and BackgroundEidGenerator classes. | 16 // ForegroundEidGenerator and BackgroundEidGenerator classes. |
14 class RawEidGenerator { | 17 class RawEidGenerator { |
15 public: | 18 public: |
16 virtual ~RawEidGenerator() {} | 19 virtual ~RawEidGenerator() {} |
17 | 20 |
18 // The size of an EID in bytes. | 21 // The size of an EID in bytes. |
19 static const int32_t kNumBytesInEidValue; | 22 static const int32_t kNumBytesInEidValue; |
20 | 23 |
24 // Converts a eid to a user-readable debug string. | |
25 static std::string EidToDebugString(const std::string& eid); | |
Kyle Horimoto
2017/04/28 22:19:16
I think you forgot to upload the .cc file (or you
Tim Song
2017/04/29 01:07:50
Sorry, I didn't mean for this file to be in the CL
| |
26 | |
21 // Generates the EID at |start_of_period_timestamp_ms| using the given | 27 // Generates the EID at |start_of_period_timestamp_ms| using the given |
22 // |eid_seed|. If |extra_entropy| is not null, then it will be used in the EID | 28 // |eid_seed|. If |extra_entropy| is not null, then it will be used in the EID |
23 // calculation. | 29 // calculation. |
24 virtual std::string GenerateEid(const std::string& eid_seed, | 30 virtual std::string GenerateEid(const std::string& eid_seed, |
25 int64_t start_of_period_timestamp_ms, | 31 int64_t start_of_period_timestamp_ms, |
26 std::string const* extra_entropy) = 0; | 32 std::string const* extra_entropy) = 0; |
27 }; | 33 }; |
28 | 34 |
29 } // cryptauth | 35 } // cryptauth |
30 | 36 |
31 #endif // COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_ | 37 #endif // COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_ |
OLD | NEW |