|
17 | 17 |
|
18 | 18 | //! Configuration and utilities for Parquet Modular Encryption
|
19 | 19 |
|
20 |
| -use crate::encryption::ciphers::{BlockEncryptor, RingGcmBlockEncryptor, NONCE_LEN, SIZE_LEN, TAG_LEN}; |
| 20 | +use crate::encryption::ciphers::{ |
| 21 | + BlockEncryptor, RingGcmBlockEncryptor, NONCE_LEN, SIZE_LEN, TAG_LEN, |
| 22 | +}; |
21 | 23 | use crate::errors::{ParquetError, Result};
|
22 | 24 | use crate::file::column_crypto_metadata::{ColumnCryptoMetaData, EncryptionWithColumnKey};
|
| 25 | +use crate::format::{AesGcmV1, EncryptionAlgorithm}; |
23 | 26 | use crate::schema::types::{ColumnDescPtr, SchemaDescriptor};
|
24 | 27 | use crate::thrift::TSerializable;
|
25 | 28 | use ring::rand::{SecureRandom, SystemRandom};
|
26 | 29 | use std::collections::{HashMap, HashSet};
|
27 | 30 | use std::io::Write;
|
28 | 31 | use thrift::protocol::TCompactOutputProtocol;
|
29 |
| -use crate::format::{AesGcmV1, EncryptionAlgorithm}; |
30 | 32 |
|
31 | 33 | #[derive(Debug, Clone, PartialEq)]
|
32 | 34 | struct EncryptionKey {
|
@@ -361,11 +363,12 @@ impl FileEncryptor {
|
361 | 363 | Some(column_key) => Ok(Box::new(RingGcmBlockEncryptor::new(column_key.key())?)),
|
362 | 364 | }
|
363 | 365 | }
|
364 |
| - |
| 366 | + |
365 | 367 | /// Get encryption algorithm for the plaintext footer
|
366 | 368 | pub(crate) fn get_footer_encryptor_for_plaintext(&self) -> Result<Option<EncryptionAlgorithm>> {
|
367 | 369 | if !self.properties.encrypt_footer() {
|
368 |
| - let supply_aad_prefix = self.properties |
| 370 | + let supply_aad_prefix = self |
| 371 | + .properties |
369 | 372 | .aad_prefix()
|
370 | 373 | .map(|_| !self.properties.store_aad_prefix());
|
371 | 374 | let encryption_algorithm = Some(EncryptionAlgorithm::AESGCMV1(AesGcmV1 {
|
|
0 commit comments