diff --git a/cipher/src/stream/wrapper.rs b/cipher/src/stream/wrapper.rs index 5789cdddd..5b9513c37 100644 --- a/cipher/src/stream/wrapper.rs +++ b/cipher/src/stream/wrapper.rs @@ -37,6 +37,14 @@ impl fmt::Debug for StreamCipherCoreWrapper } impl StreamCipherCoreWrapper { + /// 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,