From 4ae7d66bd28d208375ccdbdd55568606b92ef606 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 21 Mar 2021 15:56:04 +0000 Subject: [PATCH] change stack buffer size --- src/stream.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stream.rs b/src/stream.rs index 4c5d0a5..54ed35f 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -11,7 +11,7 @@ use openssl::{ }; use smallvec::SmallVec; -pub const BUFFER_SIZE: usize = 1024; +pub const BUFFER_SIZE: usize = 32; pub type Error = ErrorStack; /// ChaCha Sink @@ -52,6 +52,7 @@ where W: Write { Ok(Self::new(stream, cha::decrypter(key, iv)?)) } + /// Consume into the inner stream pub fn into_inner(self) -> W @@ -126,7 +127,7 @@ mod tests { use super::*; - const INPUT: &'static str = "Hello world!"; + const INPUT: &'static str = "Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!"; fn enc_stream(input: impl AsRef<[u8]>, key: Key, iv: IV) -> Sink> { @@ -155,6 +156,7 @@ mod tests #[test] fn dec() { + println!(">>> Sink's size with ref is {}", std::mem::size_of::>>()); let (key, iv) = cha::keygen(); eprintln!("Input unencrypted: {}", INPUT.hex());