xanderbailey commented on code in PR #3236:
URL: https://github.com/apache/iceberg-rust/pull/3236#discussion_r4024439818


##########
crates/iceberg/src/encryption/io.rs:
##########
@@ -74,14 +73,30 @@ impl EncryptedInputFile {
 
     /// Creates a reader that transparently decrypts on each read.
     pub async fn reader(&self) -> Result<Box<dyn FileRead>> {
-        let raw_meta = self.inner.metadata().await?;
+        let encrypted_length = self.encrypted_length()?;
         let raw_reader = self.inner.reader().await?;
         let cipher = build_cipher(&self.key_metadata)?;
         let aad_prefix: Box<[u8]> = 
self.key_metadata.aad_prefix().unwrap_or_default().into();
-        let decrypting = AesGcmFileRead::new(raw_reader, cipher, aad_prefix, 
raw_meta.size)?;
+        let decrypting = AesGcmFileRead::new(raw_reader, cipher, aad_prefix, 
encrypted_length)?;
         Ok(Box::new(decrypting))
     }
 
+    fn encrypted_length(&self) -> Result<u64> {

Review Comment:
   Posted below but I think the hard break is fine yet since we haven't had an 
iceberg-rust release with this feature enabled. WDYT? I'd like to be consistent 
with the Java client here if possible



-- 
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]

Reply via email to