|
38 | 38 | #include "parquet/platform.h" |
39 | 39 | #include "parquet/test_util.h" |
40 | 40 | #include "parquet/thrift_internal.h" |
41 | | -#include "parquet/types.h" |
42 | 41 |
|
43 | 42 | namespace parquet::encryption::test { |
44 | 43 | namespace { |
@@ -77,16 +76,10 @@ EncryptedBloomFilterPayload BuildEncryptedBloomFilterPayload(int32_t bitset_size |
77 | 76 | serializer.Serialize(&header, header_sink.get()); |
78 | 77 | PARQUET_ASSIGN_OR_THROW(auto header_buf, header_sink->Finish()); |
79 | 78 |
|
80 | | - const std::string file_aad = "file_aad"; |
81 | | - const int16_t row_group_ordinal = 0; |
82 | | - const int16_t column_ordinal = 0; |
83 | | - // AAD must match the module type, row group, and column ordinals. |
84 | | - const std::string header_aad = |
85 | | - encryption::CreateModuleAad(file_aad, encryption::kBloomFilterHeader, |
86 | | - row_group_ordinal, column_ordinal, kNonPageOrdinal); |
87 | | - const std::string bitset_aad = |
88 | | - encryption::CreateModuleAad(file_aad, encryption::kBloomFilterBitset, |
89 | | - row_group_ordinal, column_ordinal, kNonPageOrdinal); |
| 79 | + // Use fixed AAD strings for the test. The encryptor and decryptor must use |
| 80 | + // the same AAD, but the exact value does not matter for unit testing Deserialize. |
| 81 | + const std::string header_aad = "test_bloom_filter_header_aad"; |
| 82 | + const std::string bitset_aad = "test_bloom_filter_bitset_aad"; |
90 | 83 |
|
91 | 84 | // Use fixed keys for deterministic test data. |
92 | 85 | const ::arrow::util::SecureString header_key("0123456789abcdef"); |
@@ -134,11 +127,11 @@ EncryptedBloomFilterPayload BuildEncryptedBloomFilterPayload(int32_t bitset_size |
134 | 127 | payload.header_decryptor = std::make_unique<Decryptor>( |
135 | 128 | encryption::AesDecryptor::Make(ParquetCipher::AES_GCM_V1, |
136 | 129 | static_cast<int32_t>(header_key.size()), true), |
137 | | - header_key, file_aad, header_aad, ::arrow::default_memory_pool()); |
| 130 | + header_key, "", header_aad, ::arrow::default_memory_pool()); |
138 | 131 | payload.bitset_decryptor = std::make_unique<Decryptor>( |
139 | 132 | encryption::AesDecryptor::Make(ParquetCipher::AES_GCM_V1, |
140 | 133 | static_cast<int32_t>(bitset_key.size()), false), |
141 | | - bitset_key, file_aad, bitset_aad, ::arrow::default_memory_pool()); |
| 134 | + bitset_key, "", bitset_aad, ::arrow::default_memory_pool()); |
142 | 135 |
|
143 | 136 | return payload; |
144 | 137 | } |
|
0 commit comments