mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Add FakeFastPairDataEncryptor to help unit test FastPairHandshake
PiperOrigin-RevId: 518967535
This commit is contained in:
committed by
Copybara-Service
parent
f2331cfb42
commit
fd955d864f
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user