fast_pair_decryption.h 1.1 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_SERVICES_QUICK_PAIR_FAST_PAIR_DECRYPTION_H_
  5. #define ASH_SERVICES_QUICK_PAIR_FAST_PAIR_DECRYPTION_H_
  6. #include <array>
  7. #include <string>
  8. #include "ash/services/quick_pair/public/cpp/decrypted_passkey.h"
  9. #include "ash/services/quick_pair/public/cpp/decrypted_response.h"
  10. #include "third_party/abseil-cpp/absl/types/optional.h"
  11. namespace ash {
  12. namespace quick_pair {
  13. namespace fast_pair_decryption {
  14. inline constexpr int kBlockByteSize = 16;
  15. absl::optional<DecryptedResponse> ParseDecryptedResponse(
  16. const std::array<uint8_t, 16>& aes_key_bytes,
  17. const std::array<uint8_t, 16>& encrypted_response_bytes);
  18. absl::optional<DecryptedPasskey> ParseDecryptedPasskey(
  19. const std::array<uint8_t, 16>& aes_key_bytes,
  20. const std::array<uint8_t, 16>& encrypted_passkey_bytes);
  21. } // namespace fast_pair_decryption
  22. } // namespace quick_pair
  23. } // namespace ash
  24. #endif // ASH_SERVICES_QUICK_PAIR_FAST_PAIR_DECRYPTION_H_