adamreeve commented on code in PR #43195:
URL: https://github.com/apache/arrow/pull/43195#discussion_r1673413325
##########
cpp/src/parquet/encryption/encryption_internal.cc:
##########
@@ -170,45 +204,53 @@ int AesEncryptor::AesEncryptorImpl::Encrypt(const
uint8_t* plaintext, int plaint
RAND_bytes(nonce, sizeof(nonce));
if (kGcmMode == aes_mode_) {
- return GcmEncrypt(plaintext, plaintext_len, key, key_len, nonce, aad,
aad_len,
- ciphertext);
+ return GcmEncrypt(plaintext, key, nonce, aad, ciphertext);
}
- return CtrEncrypt(plaintext, plaintext_len, key, key_len, nonce, ciphertext);
+ return CtrEncrypt(plaintext, key, nonce, ciphertext);
}
-int AesEncryptor::AesEncryptorImpl::GcmEncrypt(const uint8_t* plaintext,
- int plaintext_len, const
uint8_t* key,
- int key_len, const uint8_t*
nonce,
- const uint8_t* aad, int aad_len,
- uint8_t* ciphertext) {
+int AesEncryptor::AesEncryptorImpl::GcmEncrypt(span<const uint8_t> plaintext,
+ span<const uint8_t> key,
+ span<const uint8_t> nonce,
+ span<const uint8_t> aad,
+ span<uint8_t> ciphertext) {
int len;
int ciphertext_len;
uint8_t tag[kGcmTagLength];
memset(tag, 0, kGcmTagLength);
+ if (nonce.size() < static_cast<size_t>(kNonceLength)) {
Review Comment:
Yes this has been changed to equality
--
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]