fast_pair_key_pair.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_QUICK_PAIR_FAST_PAIR_HANDSHAKE_FAST_PAIR_KEY_PAIR_H_
  5. #define ASH_QUICK_PAIR_FAST_PAIR_HANDSHAKE_FAST_PAIR_KEY_PAIR_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include <array>
  9. inline constexpr int kPrivateKeyByteSize = 16;
  10. inline constexpr int kPublicKeyByteSize = 64;
  11. namespace ash {
  12. namespace quick_pair {
  13. namespace fast_pair_encryption {
  14. // Key pair structure to represent public and private keys used for encryption/
  15. // decryption.
  16. struct KeyPair {
  17. KeyPair(std::array<uint8_t, kPrivateKeyByteSize> private_key,
  18. std::array<uint8_t, kPublicKeyByteSize> public_key);
  19. KeyPair(const KeyPair&);
  20. KeyPair(KeyPair&&);
  21. KeyPair& operator=(const KeyPair&) = delete;
  22. KeyPair& operator=(KeyPair&&) = delete;
  23. ~KeyPair() = default;
  24. const std::array<uint8_t, kPrivateKeyByteSize> private_key;
  25. const std::array<uint8_t, kPublicKeyByteSize> public_key;
  26. };
  27. } // namespace fast_pair_encryption
  28. } // namespace quick_pair
  29. } // namespace ash
  30. #endif // ASH_QUICK_PAIR_FAST_PAIR_HANDSHAKE_FAST_PAIR_KEY_PAIR_H_