#![forbid(unsafe_code)]
#![doc = include_str!("../README.md")]
#[cfg(not(any(
feature = "rustcrypto",
feature = "aws-lc-rs",
feature = "boring",
feature = "ring"
)))]
compile_error!("enable at least one FLOE provider: aws-lc-rs, boring, ring, or rustcrypto");
mod backends;
mod buffer;
mod error;
pub mod io;
mod key;
pub mod online;
mod parameters;
mod provider;
pub mod random_access;
mod state;
mod wire;
pub use error::{Error, LengthRequirement, Result};
pub use key::Key;
pub use online::{decrypt, decrypt_with_parameters, encrypt};
pub use parameters::{Parameters, SEGMENT_PREFIX_LENGTH, SegmentFraming, SegmentKind};
pub use provider::Provider;
pub use state::Header;
pub mod low_level {
pub use crate::buffer::SegmentBuffer;
pub use crate::parameters::{
MessageLayout, SEGMENT_PAYLOAD_OFFSET, SegmentKind, SegmentLayout, Segments,
};
pub use crate::state::{
DecryptionState, EncryptionState, SharedDecryptionContext, SharedEncryptionContext,
start_decryption, start_decryption_inferred, start_encryption,
};
}
pub(crate) use buffer::SegmentBuffer;
pub(crate) use parameters::{
AEAD_IV_LENGTH, AEAD_MAX_SEGMENTS, AEAD_TAG_LENGTH, ENCODED_PARAMETERS_LENGTH, FLOE_IV_LENGTH,
HEADER_LENGTH, HEADER_LENGTH_U64, HEADER_TAG_LENGTH, SEGMENT_OVERHEAD, SEGMENT_PAYLOAD_OFFSET,
SegmentLayout, length_u32_to_usize, length_u64_to_usize_saturating, length_usize_to_u64,
};
pub(crate) use state::{
DecryptionState, EncryptionState, start_decryption, start_decryption_inferred, start_encryption,
};
#[cfg(test)]
mod tests;