MCPcopy Create free account
hub / github.com/apache/arrow / SignedFooterEncrypt

Method SignedFooterEncrypt

cpp/src/parquet/encryption/encryption_internal.cc:177–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177int32_t AesEncryptor::AesEncryptorImpl::SignedFooterEncrypt(
178 std::span<const uint8_t> footer, std::span<const uint8_t> key,
179 std::span<const uint8_t> aad, std::span<const uint8_t> nonce,
180 std::span<uint8_t> encrypted_footer) {
181 if (static_cast<size_t>(key_length_) != key.size()) {
182 std::stringstream ss;
183 ss << "Wrong key length " << key.size() << ". Should be " << key_length_;
184 throw ParquetException(ss.str());
185 }
186
187 if (encrypted_footer.size() != footer.size() + ciphertext_size_delta_) {
188 std::stringstream ss;
189 ss << "Encrypted footer buffer length " << encrypted_footer.size()
190 << " does not match expected length " << (footer.size() + ciphertext_size_delta_);
191 throw ParquetException(ss.str());
192 }
193
194 if (kGcmMode != aes_mode_) {
195 throw ParquetException("Must use AES GCM (metadata) encryptor");
196 }
197
198 return GcmEncrypt(footer, key, nonce, aad, encrypted_footer);
199}
200
201int32_t AesEncryptor::AesEncryptorImpl::Encrypt(std::span<const uint8_t> plaintext,
202 std::span<const uint8_t> key,

Callers 2

VerifySignatureMethod · 0.45
VerifySignatureMethod · 0.45

Calls 3

ParquetExceptionFunction · 0.85
strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected