coffio/src/lib.rs

39 lines
1.6 KiB
Rust
Raw Normal View History

mod canonicalization;
#[cfg(feature = "encryption")]
mod encryption;
2024-03-02 14:55:14 +01:00
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
2024-02-15 10:56:21 +01:00
mod error;
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
2024-02-14 23:11:00 +01:00
mod ikm;
2024-02-15 23:45:21 +01:00
#[cfg(feature = "encryption")]
mod kdf;
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
2024-02-15 10:00:06 +01:00
mod scheme;
2024-02-17 20:26:45 +01:00
#[cfg(feature = "encryption")]
mod storage;
2024-02-14 18:16:45 +01:00
#[cfg(feature = "encryption")]
pub use encryption::{decrypt, encrypt};
2024-03-02 14:55:14 +01:00
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
2024-02-15 10:56:21 +01:00
pub use error::Error;
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
pub use ikm::{IkmId, InputKeyMaterial, InputKeyMaterialList};
#[cfg(feature = "encryption")]
pub use kdf::KeyContext;
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
2024-02-15 10:00:06 +01:00
pub use scheme::Scheme;
2024-02-14 18:16:45 +01:00
/// Default amount of time during which the input key material will be considered valid once it has been generated.
/// This value is expressed in seconds.
///
/// Considering that a day is composed of 86400 seconds (60×60×24) and a year is 365.24219 days (approximate value of the [mean tropical year][tropical_year]), this value is equivalent to 10 years.
///
/// [tropical_year]: https://en.wikipedia.org/wiki/Tropical_year
#[cfg(feature = "ikm-management")]
pub const DEFAULT_IKM_DURATION: u64 = 315_569_252;
#[cfg(feature = "ikm-management")]
2024-02-15 10:00:06 +01:00
const DEFAULT_SCHEME: Scheme = Scheme::XChaCha20Poly1305WithBlake3;
#[cfg(not(feature = "i-understand-and-accept-the-risks"))]
compile_error!("This crate is experimental and therefore comes with absolutely no security guaranty. To use it anyway, enable the \"i-understand-and-accept-the-risks\" feature.");