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;
#[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};

View file

@ -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 {