Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed Jan 21, 2025
1 parent c2497e6 commit 951f2fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions parquet/src/arrow/arrow_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,7 @@ mod tests {
verify_encryption_test_file_read(file, decryption_properties);
}

#[cfg(feature = "encryption")]
fn verify_encryption_test_file_read(
file: File,
decryption_properties: ciphers::FileDecryptionProperties,
Expand Down
8 changes: 3 additions & 5 deletions parquet/src/encryption/ciphers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
//! Encryption implementation specific to Parquet, as described
//! in the [spec](https://github.com/apache/parquet-format/blob/master/Encryption.md).
use ring::aead::{Aad, LessSafeKey, UnboundKey, AES_128_GCM};
use std::collections::HashMap;
use std::sync::Arc;
use ring::aead::{Aad, LessSafeKey, UnboundKey, AES_128_GCM};
// use ring::aead::NonceSequence;
// use ring::rand::{SecureRandom, SystemRandom};
use crate::errors::{ParquetError, Result};
Expand Down Expand Up @@ -147,8 +147,7 @@ impl BlockDecryptor for RingGcmBlockDecryptor {
&length_and_ciphertext[SIZE_LEN..SIZE_LEN + NONCE_LEN],
)?;

self.key
.open_in_place(nonce, Aad::from(aad), &mut result)?;
self.key.open_in_place(nonce, Aad::from(aad), &mut result)?;

// Truncate result to remove the tag
result.resize(result.len() - TAG_LEN, 0u8);
Expand Down Expand Up @@ -197,7 +196,6 @@ fn create_module_aad(
column_ordinal: usize,
page_ordinal: Option<usize>,
) -> Result<Vec<u8>> {

let module_buf = [module_type as u8];

if module_buf[0] == (ModuleType::Footer as u8) {
Expand Down Expand Up @@ -429,7 +427,7 @@ impl CryptoContext {
row_group_ordinal: usize,
column_ordinal: usize,
data_decryptor: Arc<FileDecryptor>,
metadata_decryptor: Arc<FileDecryptor>
metadata_decryptor: Arc<FileDecryptor>,
) -> Self {
Self {
row_group_ordinal,
Expand Down

0 comments on commit 951f2fa

Please sign in to comment.