|
18 | 18 | //! Encryption implementation specific to Parquet, as described |
19 | 19 | //! in the [spec](https://github.com/apache/parquet-format/blob/master/Encryption.md). |
20 | 20 |
|
| 21 | +use ring::aead::{Aad, LessSafeKey, UnboundKey, AES_128_GCM}; |
21 | 22 | use std::collections::HashMap; |
22 | 23 | use std::sync::Arc; |
23 | | -use ring::aead::{Aad, LessSafeKey, UnboundKey, AES_128_GCM}; |
24 | 24 | // use ring::aead::NonceSequence; |
25 | 25 | // use ring::rand::{SecureRandom, SystemRandom}; |
26 | 26 | use crate::errors::{ParquetError, Result}; |
@@ -147,8 +147,7 @@ impl BlockDecryptor for RingGcmBlockDecryptor { |
147 | 147 | &length_and_ciphertext[SIZE_LEN..SIZE_LEN + NONCE_LEN], |
148 | 148 | )?; |
149 | 149 |
|
150 | | - self.key |
151 | | - .open_in_place(nonce, Aad::from(aad), &mut result)?; |
| 150 | + self.key.open_in_place(nonce, Aad::from(aad), &mut result)?; |
152 | 151 |
|
153 | 152 | // Truncate result to remove the tag |
154 | 153 | result.resize(result.len() - TAG_LEN, 0u8); |
@@ -197,7 +196,6 @@ fn create_module_aad( |
197 | 196 | column_ordinal: usize, |
198 | 197 | page_ordinal: Option<usize>, |
199 | 198 | ) -> Result<Vec<u8>> { |
200 | | - |
201 | 199 | let module_buf = [module_type as u8]; |
202 | 200 |
|
203 | 201 | if module_buf[0] == (ModuleType::Footer as u8) { |
@@ -429,7 +427,7 @@ impl CryptoContext { |
429 | 427 | row_group_ordinal: usize, |
430 | 428 | column_ordinal: usize, |
431 | 429 | data_decryptor: Arc<FileDecryptor>, |
432 | | - metadata_decryptor: Arc<FileDecryptor> |
| 430 | + metadata_decryptor: Arc<FileDecryptor>, |
433 | 431 | ) -> Self { |
434 | 432 | Self { |
435 | 433 | row_group_ordinal, |
|
0 commit comments