adamreeve commented on code in PR #43195:
URL: https://github.com/apache/arrow/pull/43195#discussion_r1673413168


##########
cpp/src/parquet/encryption/encryption_internal.cc:
##########
@@ -137,30 +156,45 @@ 
AesEncryptor::AesEncryptorImpl::AesEncryptorImpl(ParquetCipher::type alg_id, int
   }
 }
 
-int AesEncryptor::AesEncryptorImpl::SignedFooterEncrypt(
-    const uint8_t* footer, int footer_len, const uint8_t* key, int key_len,
-    const uint8_t* aad, int aad_len, const uint8_t* nonce, uint8_t* 
encrypted_footer) {
-  if (key_length_ != key_len) {
+int AesEncryptor::AesEncryptorImpl::SignedFooterEncrypt(span<const uint8_t> 
footer,
+                                                        span<const uint8_t> 
key,
+                                                        span<const uint8_t> 
aad,
+                                                        span<const uint8_t> 
nonce,
+                                                        span<uint8_t> 
encrypted_footer) {
+  if (static_cast<size_t>(key_length_) != key.size()) {
+    std::stringstream ss;
+    ss << "Wrong key length " << key.size() << ". Should be " << key_length_;
+    throw ParquetException(ss.str());
+  }
+
+  if (encrypted_footer.size() < footer.size() + ciphertext_size_delta_) {

Review Comment:
   I've changed this to equality now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to