1#![forbid(unsafe_code)]
2#![doc = include_str!("../README.md")]
3
4#[cfg(not(any(
5 feature = "rustcrypto",
6 feature = "aws-lc-rs",
7 feature = "boring",
8 feature = "ring"
9)))]
10compile_error!("enable at least one FLOE provider: aws-lc-rs, boring, ring, or rustcrypto");
11
12mod backends;
13mod buffer;
14mod error;
15pub mod io;
16mod key;
17pub mod online;
18mod parameters;
19mod provider;
20pub mod random_access;
21mod state;
22mod wire;
23
24pub use error::{Error, LengthRequirement, Result};
25pub use key::Key;
26pub use online::{decrypt, decrypt_with_parameters, encrypt};
27pub use parameters::{Parameters, SEGMENT_PREFIX_LENGTH, SegmentFraming, SegmentKind};
28pub use provider::Provider;
29pub use state::Header;
30
31pub mod low_level {
47 pub use crate::buffer::SegmentBuffer;
48 pub use crate::parameters::{
49 MessageLayout, SEGMENT_PAYLOAD_OFFSET, SegmentKind, SegmentLayout, Segments,
50 };
51 pub use crate::state::{
52 DecryptionState, EncryptionState, SharedDecryptionContext, SharedEncryptionContext,
53 start_decryption, start_decryption_inferred, start_encryption,
54 };
55}
56
57pub(crate) use buffer::SegmentBuffer;
58pub(crate) use parameters::{
59 AEAD_IV_LENGTH, AEAD_MAX_SEGMENTS, AEAD_TAG_LENGTH, ENCODED_PARAMETERS_LENGTH, FLOE_IV_LENGTH,
60 HEADER_LENGTH, HEADER_LENGTH_U64, HEADER_TAG_LENGTH, SEGMENT_OVERHEAD, SEGMENT_PAYLOAD_OFFSET,
61 SegmentLayout, length_u32_to_usize, length_u64_to_usize_saturating, length_usize_to_u64,
62};
63pub(crate) use state::{
64 DecryptionState, EncryptionState, start_decryption, start_decryption_inferred, start_encryption,
65};
66
67#[cfg(test)]
68mod tests;