From 675544c4b551aff2418fde629b0919fde0d09faa Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 21 Mar 2021 23:12:46 +0000 Subject: [PATCH] fix error messages --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- src/main.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d509e6..68be4c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chacha20" -version = "1.0.1" +version = "1.0.2" dependencies = [ "base64", "getrandom", diff --git a/Cargo.toml b/Cargo.toml index 3a02907..db95376 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chacha20" description = "chacha20_poly1305 encryption tool" -version = "1.0.1" +version = "1.0.2" authors = ["Avril "] edition = "2018" license = "gpl-3.0-or-later" @@ -10,4 +10,4 @@ license = "gpl-3.0-or-later" base64 = "0.13" getrandom = "0.2" openssl = "0.10" -smallvec = {version = "1.6", features=["write", "union"]} \ No newline at end of file +smallvec = {version = "1.6", features=["union"]} diff --git a/src/main.rs b/src/main.rs index b4858a7..aeccbda 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,8 +92,8 @@ fn main() { output.flush().expect("Failed to flush stdout"); }, Mode::Decrypt => { - let mut output = stream::Sink::decrypt(stdout.lock(), key, iv).expect("Failed to create encrypter"); - std::io::copy(&mut input.lock(), &mut output).expect("Failed to encrypt"); + let mut output = stream::Sink::decrypt(stdout.lock(), key, iv).expect("Failed to create decrypter"); + std::io::copy(&mut input.lock(), &mut output).expect("Failed to decrypt"); output.flush().expect("Failed to flush stdout"); }, Mode::Keygen => {