Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cipher/src/stream/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ impl<T: StreamCipherCore + fmt::Debug> fmt::Debug for StreamCipherCoreWrapper<T>
}

impl<T: StreamCipherCore> StreamCipherCoreWrapper<T> {
/// Initialize from a [`StreamCipherCore`] instance.
pub fn from_core(core: T) -> Self {
Self {
core,
buffer: Default::default(),
}
}

fn check_remaining(&self, data_len: usize) -> Result<(), StreamCipherError> {
let rem_blocks = match self.core.remaining_blocks() {
Some(v) => v,
Expand Down