adamreeve commented on code in PR #7459:
URL: https://github.com/apache/arrow-rs/pull/7459#discussion_r2070892152


##########
parquet/src/encryption/ciphers.rs:
##########
@@ -23,12 +23,14 @@ use ring::rand::{SecureRandom, SystemRandom};
 use std::fmt::Debug;
 
 const RIGHT_TWELVE: u128 = 0x0000_0000_ffff_ffff_ffff_ffff_ffff_ffff;
-const NONCE_LEN: usize = 12;
-const TAG_LEN: usize = 16;
-const SIZE_LEN: usize = 4;
+pub(crate) const NONCE_LEN: usize = 12;
+pub(crate) const TAG_LEN: usize = 16;
+pub(crate) const SIZE_LEN: usize = 4;
 
 pub(crate) trait BlockDecryptor: Debug + Send + Sync {
     fn decrypt(&self, length_and_ciphertext: &[u8], aad: &[u8]) -> 
Result<Vec<u8>>;
+
+    fn compute_tag(&self, nonce: &[u8], aad: &[u8], ciphertext: &mut [u8]) -> 
Result<Vec<u8>>;

Review Comment:
   After thinking about this more and looking at the rest of the PR I think 
this approach makes sense and a CTR decryptor could just return an error. Even 
in GCM-CTR mode only the data pages use AES-CTR and the footer will still use 
AES-GCM so that should be fine.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to