commit | f91f4450d219a97c9e4e829ebfcb96653b0d5c6e | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Wed Nov 22 23:59:11 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 22 23:59:11 2023 +0000 |
tree | 703d303ec5d63ecbfd61f067eb5fe950056119da | |
parent | 4fa0093d8f6e4d4f6d944375541b29a8d28ed06c [diff] | |
parent | a8d2f89b8eb2d58d3476af6841722e09a1d28035 [diff] |
Migrate to cargo_embargo. am: ce949f372b am: a8d2f89b8e Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/zeroize/+/2836656 Change-Id: I2d7589396d4e946b6e13854988f2e60e590e2223 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Securely zero memory (a.k.a. zeroize) while avoiding compiler optimizations.
This crate implements a portable approach to securely zeroing memory using techniques which guarantee they won't be “optimized away” by the compiler.
The Zeroize
trait is the crate's primary API.
Zeroing memory securely is hard - compilers optimize for performance, and in doing so they love to “optimize away” unnecessary zeroing calls. There are many documented “tricks” to attempt to avoid these optimizations and ensure that a zeroing routine is performed reliably.
This crate isn‘t about tricks: it uses core::ptr::write_volatile and core::sync::atomic memory fences to provide easy-to-use, portable zeroing behavior which works on all of Rust’s core number types and slices thereof, implemented in pure Rust with no usage of FFI or assembly.
#![no_std]
i.e. embedded-friendly!Rust 1.56 or newer.
In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope for this crate's SemVer guarantees), however when we do it will be accompanied by a minor version bump.
Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.