rdblue commented on code in PR #3231:
URL: https://github.com/apache/iceberg/pull/3231#discussion_r1278601221
##########
core/src/main/java/org/apache/iceberg/encryption/Ciphers.java:
##########
@@ -101,37 +117,52 @@ public AesGcmDecryptor(byte[] keyBytes) {
}
public byte[] decrypt(byte[] ciphertext, byte[] aad) {
- int plainTextLength = ciphertext.length - GCM_TAG_LENGTH - NONCE_LENGTH;
+ return decrypt(ciphertext, 0, ciphertext.length, aad);
+ }
+
+ public byte[] decrypt(
+ byte[] ciphertext, int ciphertextOffset, int ciphertextLength, byte[]
aad) {
Preconditions.checkState(
- plainTextLength >= 1,
+ ciphertextLength - GCM_TAG_LENGTH - NONCE_LENGTH >= 1,
Review Comment:
Should there be a similar check in the encrypt method to validate that the
plaintext has at least one byte?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]