Fix the features

This commit is contained in:
Rodolphe Bréard 2024-03-02 14:55:14 +01:00
parent a13411f122
commit bdfaf8adff
2 changed files with 7 additions and 0 deletions

View file

@ -1,6 +1,7 @@
mod canonicalization; mod canonicalization;
#[cfg(feature = "encryption")] #[cfg(feature = "encryption")]
mod encryption; mod encryption;
#[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"))]
mod ikm; mod ikm;
@ -13,6 +14,7 @@ mod storage;
#[cfg(feature = "encryption")] #[cfg(feature = "encryption")]
pub use encryption::{decrypt, encrypt}; pub use encryption::{decrypt, encrypt};
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
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::{IkmId, InputKeyMaterial, InputKeyMaterialList}; pub use ikm::{IkmId, InputKeyMaterial, InputKeyMaterialList};

View file

@ -1,8 +1,12 @@
#[cfg(feature = "encryption")]
use crate::encryption::{DecryptionFunction, EncryptionFunction}; use crate::encryption::{DecryptionFunction, EncryptionFunction};
#[cfg(feature = "encryption")]
use crate::kdf::KdfFunction; use crate::kdf::KdfFunction;
use crate::Error; use crate::Error;
#[cfg(feature = "encryption")]
mod blake3; mod blake3;
#[cfg(feature = "encryption")]
mod xchacha20poly1305; mod xchacha20poly1305;
pub(crate) type SchemeSerializeType = u32; pub(crate) type SchemeSerializeType = u32;
@ -12,6 +16,7 @@ pub enum Scheme {
XChaCha20Poly1305WithBlake3 = 1, XChaCha20Poly1305WithBlake3 = 1,
} }
#[cfg(feature = "encryption")]
impl Scheme { impl Scheme {
pub(crate) fn get_ikm_size(&self) -> usize { pub(crate) fn get_ikm_size(&self) -> usize {
match self { match self {