Add FakeFastPairDataEncryptor to help unit test FastPairHandshake

PiperOrigin-RevId: 518967535
This commit is contained in:
Qin Wang
2023-03-23 14:44:42 -07:00
committed by Copybara-Service
parent f2331cfb42
commit fd955d864f
7 changed files with 120 additions and 26 deletions
+3 -2
View File
@@ -33,8 +33,8 @@
namespace nearby {
namespace fastpair {
std::array<uint8_t, kAesBlockByteSize> FastPairDecryption::DecryptBytes(
namespace {
std::array<uint8_t, kAesBlockByteSize> DecryptBytes(
const std::array<uint8_t, kAesBlockByteSize>& aes_key_bytes,
const std::array<uint8_t, kAesBlockByteSize>& encrypted_bytes) {
AES_KEY aes_key;
@@ -48,6 +48,7 @@ std::array<uint8_t, kAesBlockByteSize> FastPairDecryption::DecryptBytes(
AES_decrypt(encrypted_bytes.data(), decrypted_bytes.data(), &aes_key);
return decrypted_bytes;
}
} // namespace
// Decrypts the encrypted response
// (https://developers.google.com/nearby/fast-pair/specifications/characteristics#table1.4)