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


##########
crates/iceberg/src/encryption/stream.rs:
##########
@@ -975,7 +989,13 @@ mod tests {
         let key = b"0123456789abcdef";
         let aad_prefix = b"test-aad-prefix!";
 
-        for plaintext in [b"".as_slice(), b"sensitive data".as_slice()] {
+        let multi_block = vec![7u8; PLAIN_BLOCK_SIZE as usize + 10];
+        let past_first_block = PLAIN_BLOCK_SIZE as u64..PLAIN_BLOCK_SIZE as 
u64 + 10;
+        for (plaintext, range) in [
+            (b"".as_slice(), 0..0),
+            (b"sensitive data".as_slice(), 0..14),
+            (multi_block.as_slice(), past_first_block),

Review Comment:
   
[be75eec](https://github.com/apache/iceberg-rust/pull/3700/commits/be75eecfda9df5f309e30d7f6d9c837ee89f80c3)



##########
crates/iceberg/src/encryption/stream.rs:
##########
@@ -997,13 +1017,61 @@ mod tests {
                 )
                 .unwrap();
 
-                let err = reader.read(0..plaintext.len() as 
u64).await.unwrap_err();
+                let err = reader.read(range.clone()).await.unwrap_err();
                 assert_eq!(err.kind(), ErrorKind::DataInvalid);
                 assert_eq!(err.message(), message);
             }
         }
     }
 
+    #[tokio::test]
+    async fn test_header_is_checked_once() {

Review Comment:
   
[be75eec](https://github.com/apache/iceberg-rust/pull/3700/commits/be75eecfda9df5f309e30d7f6d9c837ee89f80c3)



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