fast_pair_encryption.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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_ENCRYPTION_H_
  5. #define ASH_QUICK_PAIR_FAST_PAIR_HANDSHAKE_FAST_PAIR_ENCRYPTION_H_
  6. #include <stdint.h>
  7. #include <array>
  8. #include <string>
  9. #include "ash/quick_pair/fast_pair_handshake/fast_pair_key_pair.h"
  10. #include "third_party/abseil-cpp/absl/types/optional.h"
  11. namespace ash {
  12. namespace quick_pair {
  13. namespace fast_pair_encryption {
  14. constexpr int kBlockByteSize = 16;
  15. absl::optional<KeyPair> GenerateKeysWithEcdhKeyAgreement(
  16. const std::string& decoded_public_anti_spoofing);
  17. const std::array<uint8_t, kBlockByteSize> EncryptBytes(
  18. const std::array<uint8_t, kBlockByteSize>& aes_key_bytes,
  19. const std::array<uint8_t, kBlockByteSize>& bytes_to_encrypt);
  20. } // namespace fast_pair_encryption
  21. } // namespace quick_pair
  22. } // namespace ash
  23. #endif // ASH_QUICK_PAIR_FAST_PAIR_HANDSHAKE_FAST_PAIR_ENCRYPTION_H_