Move the EncryptedData struct to a dedicated module
This commit is contained in:
parent
5803e2971d
commit
e6f7167525
6 changed files with 10 additions and 9 deletions
|
@ -5,12 +5,6 @@ use crate::kdf::derive_key;
|
||||||
use crate::{storage, IkmId, InputKeyMaterialList};
|
use crate::{storage, IkmId, InputKeyMaterialList};
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub(crate) struct EncryptedData {
|
|
||||||
pub(crate) nonce: Vec<u8>,
|
|
||||||
pub(crate) ciphertext: Vec<u8>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct CipherBox<'a> {
|
pub struct CipherBox<'a> {
|
||||||
ikm_list: &'a InputKeyMaterialList,
|
ikm_list: &'a InputKeyMaterialList,
|
||||||
}
|
}
|
||||||
|
|
5
src/encrypted_data.rs
Normal file
5
src/encrypted_data.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub(crate) struct EncryptedData {
|
||||||
|
pub(crate) nonce: Vec<u8>,
|
||||||
|
pub(crate) ciphertext: Vec<u8>,
|
||||||
|
}
|
|
@ -4,6 +4,8 @@ mod canonicalization;
|
||||||
mod cipher_box;
|
mod cipher_box;
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
mod context;
|
mod context;
|
||||||
|
#[cfg(feature = "encryption")]
|
||||||
|
mod encrypted_data;
|
||||||
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
||||||
mod error;
|
mod error;
|
||||||
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
use crate::cipher_box::EncryptedData;
|
use crate::encrypted_data::EncryptedData;
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::cipher_box::EncryptedData;
|
use crate::encrypted_data::EncryptedData;
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
use chacha20poly1305::aead::{Aead, KeyInit, Payload};
|
use chacha20poly1305::aead::{Aead, KeyInit, Payload};
|
||||||
use chacha20poly1305::{Key, XChaCha20Poly1305, XNonce};
|
use chacha20poly1305::{Key, XChaCha20Poly1305, XNonce};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
use crate::cipher_box::EncryptedData;
|
use crate::encrypted_data::EncryptedData;
|
||||||
use crate::error::{Error, Result};
|
use crate::error::{Error, Result};
|
||||||
#[cfg(feature = "encryption")]
|
#[cfg(feature = "encryption")]
|
||||||
use crate::ikm::IkmId;
|
use crate::ikm::IkmId;
|
||||||
|
|
Loading…
Reference in a new issue