From 9d9d878c2dcda6b71d1b11be4a05f6356d57f0c5 Mon Sep 17 00:00:00 2001 From: Avril Date: Mon, 22 Mar 2021 23:46:11 +0000 Subject: [PATCH] update README --- Cargo.lock | 2 +- README.md | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 0cb224d..786a7b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,7 +34,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chacha20" -version = "1.0.2" +version = "1.1.0" dependencies = [ "base64", "getrandom", diff --git a/README.md b/README.md index 0e07387..44ac183 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,15 @@ Run `cargo build --release`, the binary will be built to `./target/release/chach Run `cargo test && cargo build && ./test.sh debug` to test the program. Alternatively, run `./test.sh` after building to test the release build's correctness. +## Features +To enable explicit buffer clearing, compile with the option `--features explicit_clear`. + +The `explicit_clear` feature forces any temporary work buffers to be zeroed out in memory when the corresponding stream is flushed itself. +It requires the nonstandard glibc extension `explicit_bzero(void*, size_t)` to build. +On x86 targets with the Rust nightly toolchain installed, this will also force a cache flush of the corresponding memory address. +This is *usually not needed*, and can cause a slowdown; but it prevents any lingering data being left in the buffer. +The unit test `remainder()` checks the process' memory map for leftover data in the working buffer when testing with this feature enabled. + # Usage Copies stdin to stdout while encrypting or decrypting with the stream cipher `chacha20_poly1305`.