diff --git a/src/cipher_box.rs b/src/cipher_box.rs index 34a3e02..cd3e50f 100644 --- a/src/cipher_box.rs +++ b/src/cipher_box.rs @@ -5,12 +5,6 @@ use crate::kdf::derive_key; use crate::{storage, IkmId, InputKeyMaterialList}; use std::time::{SystemTime, UNIX_EPOCH}; -#[derive(Debug)] -pub(crate) struct EncryptedData { - pub(crate) nonce: Vec, - pub(crate) ciphertext: Vec, -} - pub struct CipherBox<'a> { ikm_list: &'a InputKeyMaterialList, } diff --git a/src/encrypted_data.rs b/src/encrypted_data.rs new file mode 100644 index 0000000..02778a5 --- /dev/null +++ b/src/encrypted_data.rs @@ -0,0 +1,5 @@ +#[derive(Debug)] +pub(crate) struct EncryptedData { + pub(crate) nonce: Vec, + pub(crate) ciphertext: Vec, +} diff --git a/src/lib.rs b/src/lib.rs index de316ed..7183f7b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,8 @@ mod canonicalization; mod cipher_box; #[cfg(feature = "encryption")] mod context; +#[cfg(feature = "encryption")] +mod encrypted_data; #[cfg(any(feature = "encryption", feature = "ikm-management"))] mod error; #[cfg(any(feature = "encryption", feature = "ikm-management"))] diff --git a/src/scheme.rs b/src/scheme.rs index a089481..73462ca 100644 --- a/src/scheme.rs +++ b/src/scheme.rs @@ -1,5 +1,5 @@ #[cfg(feature = "encryption")] -use crate::cipher_box::EncryptedData; +use crate::encrypted_data::EncryptedData; #[cfg(feature = "encryption")] use crate::error::Result; #[cfg(feature = "encryption")] diff --git a/src/scheme/xchacha20poly1305.rs b/src/scheme/xchacha20poly1305.rs index ad196f8..45329cc 100644 --- a/src/scheme/xchacha20poly1305.rs +++ b/src/scheme/xchacha20poly1305.rs @@ -1,4 +1,4 @@ -use crate::cipher_box::EncryptedData; +use crate::encrypted_data::EncryptedData; use crate::error::Result; use chacha20poly1305::aead::{Aead, KeyInit, Payload}; use chacha20poly1305::{Key, XChaCha20Poly1305, XNonce}; diff --git a/src/storage.rs b/src/storage.rs index d1f4ee8..291df40 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,5 +1,5 @@ #[cfg(feature = "encryption")] -use crate::cipher_box::EncryptedData; +use crate::encrypted_data::EncryptedData; use crate::error::{Error, Result}; #[cfg(feature = "encryption")] use crate::ikm::IkmId;