summaryrefslogtreecommitdiff
path: root/chromium/components/cryptauth/raw_eid_generator.h
blob: cab18b6a4d74007921e213c026a62d287db8cc9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_
#define COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_

#include <string>

namespace cryptauth {

// Generates raw ephemeral ID (EID) values that are used by the
// ForegroundEidGenerator and BackgroundEidGenerator classes.
class RawEidGenerator {
 public:
  virtual ~RawEidGenerator() {}

  // The size of an EID in bytes.
  static const int32_t kNumBytesInEidValue;

  // Generates the EID at |start_of_period_timestamp_ms| using the given
  // |eid_seed|. If |extra_entropy| is not null, then it will be used in the EID
  // calculation.
  virtual std::string GenerateEid(const std::string& eid_seed,
                                  int64_t start_of_period_timestamp_ms,
                                  std::string const* extra_entropy) = 0;
};

}  // cryptauth

#endif  // COMPONENTS_CRYPTAUTH_BLE_RAW_EID_GENERATOR_H_