commit | 4743a6c726d867b58cdeccbf5dcca1b03150c4ab | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Mar 10 04:19:38 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Fri Mar 10 04:19:38 2023 +0000 |
tree | 7f6716249b4ac7150acdb2d1e481c8207e53c880 | |
parent | 5f2e5f3b50c1695c55691b492fcca1bb58b42487 [diff] | |
parent | a0f4b29e8bb84e354e634ab8f1f714174ade736f [diff] |
Snap for 9719949 from f3a402fa4c43157c5c2406e4c3f33f6e938061c6 to udc-release am: a0f4b29e8b Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/zeroize/+/21946940 Change-Id: I3e4840a6504beed67383dd38a3c2f5fc3f3a29bd Signed-off-by: Automerger Merge Worker <[email protected]>
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.51 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.