From d8d867bb1eb6a80d8a8631971826fa2255f1342d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Thu, 15 Feb 2024 18:47:36 +0100 Subject: [PATCH] Expose the encryption and decryption interfaces --- src/encryption.rs | 19 +++++++++++++++++++ src/lib.rs | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 src/encryption.rs diff --git a/src/encryption.rs b/src/encryption.rs new file mode 100644 index 0000000..c32d36c --- /dev/null +++ b/src/encryption.rs @@ -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 { + unimplemented!("encrypt"); +} + +pub fn decrypt( + ikml: &InputKeyMaterialList, + key_context: &[impl AsRef<[u8]>], + data: impl AsRef<[u8]>, + data_context: &[impl AsRef<[u8]>], +) -> Result, Error> { + unimplemented!("decrypt"); +} diff --git a/src/lib.rs b/src/lib.rs index e807e46..dade1c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,13 @@ +#[cfg(feature = "encryption")] +mod encryption; mod error; #[cfg(any(feature = "encryption", feature = "ikm-management"))] mod ikm; #[cfg(any(feature = "encryption", feature = "ikm-management"))] mod scheme; +#[cfg(feature = "encryption")] +pub use encryption::{decrypt, encrypt}; pub use error::Error; #[cfg(any(feature = "encryption", feature = "ikm-management"))] pub use ikm::InputKeyMaterialList;