From bdfaf8adffcaace6773a2ea7bc7b46601a1fea24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sat, 2 Mar 2024 14:55:14 +0100 Subject: [PATCH] Fix the features --- src/lib.rs | 2 ++ src/scheme.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5664f97..3c7579b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ mod canonicalization; #[cfg(feature = "encryption")] mod encryption; +#[cfg(any(feature = "encryption", feature = "ikm-management"))] mod error; #[cfg(any(feature = "encryption", feature = "ikm-management"))] mod ikm; @@ -13,6 +14,7 @@ mod storage; #[cfg(feature = "encryption")] pub use encryption::{decrypt, encrypt}; +#[cfg(any(feature = "encryption", feature = "ikm-management"))] pub use error::Error; #[cfg(any(feature = "encryption", feature = "ikm-management"))] pub use ikm::{IkmId, InputKeyMaterial, InputKeyMaterialList}; diff --git a/src/scheme.rs b/src/scheme.rs index 8c602fe..4e71bb0 100644 --- a/src/scheme.rs +++ b/src/scheme.rs @@ -1,8 +1,12 @@ +#[cfg(feature = "encryption")] use crate::encryption::{DecryptionFunction, EncryptionFunction}; +#[cfg(feature = "encryption")] use crate::kdf::KdfFunction; use crate::Error; +#[cfg(feature = "encryption")] mod blake3; +#[cfg(feature = "encryption")] mod xchacha20poly1305; pub(crate) type SchemeSerializeType = u32; @@ -12,6 +16,7 @@ pub enum Scheme { XChaCha20Poly1305WithBlake3 = 1, } +#[cfg(feature = "encryption")] impl Scheme { pub(crate) fn get_ikm_size(&self) -> usize { match self {