@@ -104,7 +104,11 @@ TEST_F(ADBufferConstructionTest, ResponseMetadataFormat) {
104104 pb_byte_t ad_buffer[256 ];
105105 size_t ad_length;
106106 uint32_t expires_at = 2655 ;
107- uint8_t request_hash[32 ] = {0x11 , 0x22 , 0x33 , 0x44 }; // Sample hash
107+ // BLE uses AES-GCM encryption with 16-byte tags
108+ // Request hash: 1 auth method byte + 16-byte AES-GCM tag = 17 bytes
109+ uint8_t request_hash[17 ] = {Signatures_SignatureType_SIGNATURE_TYPE_AES_GCM_PERSONALIZED,
110+ 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ,
111+ 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x0E , 0x0F };
108112
109113 // Test response format
110114 int result = vcsec_peer_->construct_ad_buffer (Signatures_SignatureType_SIGNATURE_TYPE_AES_GCM_RESPONSE,
@@ -235,7 +239,9 @@ TEST_F(ADBufferConstructionTest, ResponseAlwaysIncludesFlags) {
235239 pb_byte_t ad_buffer[256 ];
236240 size_t ad_length;
237241 uint32_t expires_at = 2655 ;
238- uint8_t request_hash[32 ] = {0 };
242+ // BLE uses AES-GCM encryption with 16-byte tags
243+ // Request hash: 1 auth method byte + 16-byte AES-GCM tag = 17 bytes
244+ uint8_t request_hash[17 ] = {0 };
239245
240246 // Test response format - flags should always be included even if 0
241247 int result = vcsec_peer_->construct_ad_buffer (Signatures_SignatureType_SIGNATURE_TYPE_AES_GCM_RESPONSE,
0 commit comments