xanderbailey commented on code in PR #2026: URL: https://github.com/apache/iceberg-rust/pull/2026#discussion_r2819122906
########## crates/iceberg/src/encryption/crypto.rs: ########## @@ -0,0 +1,383 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! Core cryptographic operations for Iceberg encryption. + +use std::str::FromStr; + +use aes_gcm::aead::generic_array::typenum::Unsigned; +use aes_gcm::aead::{Aead, AeadCore, KeyInit, KeySizeUser, OsRng, Payload}; +use aes_gcm::{Aes128Gcm, Key, Nonce}; +use rand::RngCore; +use zeroize::Zeroizing; + +use crate::{Error, ErrorKind, Result}; + +/// Supported encryption algorithm. +/// Currently only AES-128-GCM is supported as it's the only algorithm +/// compatible with arrow-rs Parquet encryption. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum EncryptionAlgorithm { + /// AES-128 in GCM mode + Aes128Gcm, Review Comment: Correct, the crate has both! -- 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]
