Expose the encryption and decryption interfaces

This commit is contained in:
Rodolphe Bréard 2024-02-15 18:47:36 +01:00
parent f662e47690
commit d8d867bb1e
2 changed files with 23 additions and 0 deletions

19
src/encryption.rs Normal file
View file

@ -0,0 +1,19 @@
use crate::{Error, InputKeyMaterialList};
pub fn encrypt(
ikml: &InputKeyMaterialList,
key_context: &[impl AsRef<[u8]>],
data: impl AsRef<[u8]>,
data_context: &[impl AsRef<[u8]>],
) -> Result<String, Error> {
unimplemented!("encrypt");
}
pub fn decrypt(
ikml: &InputKeyMaterialList,
key_context: &[impl AsRef<[u8]>],
data: impl AsRef<[u8]>,
data_context: &[impl AsRef<[u8]>],
) -> Result<Vec<u8>, Error> {
unimplemented!("decrypt");
}

View file

@ -1,9 +1,13 @@
#[cfg(feature = "encryption")]
mod encryption;
mod error; mod error;
#[cfg(any(feature = "encryption", feature = "ikm-management"))] #[cfg(any(feature = "encryption", feature = "ikm-management"))]
mod ikm; mod ikm;
#[cfg(any(feature = "encryption", feature = "ikm-management"))] #[cfg(any(feature = "encryption", feature = "ikm-management"))]
mod scheme; mod scheme;
#[cfg(feature = "encryption")]
pub use encryption::{decrypt, encrypt};
pub use error::Error; pub use error::Error;
#[cfg(any(feature = "encryption", feature = "ikm-management"))] #[cfg(any(feature = "encryption", feature = "ikm-management"))]
pub use ikm::InputKeyMaterialList; pub use ikm::InputKeyMaterialList;