Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/zeroize/README.md # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / zeroize / README.md` 96 lines ยท 3614 bytes Raw Blame History Source # RustCrypto : zeroize Crate Docs Build Status Apache 2.0/MIT Licensed MSRV Project Chat 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. Documentation ## About 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 insecure fallbacks! - No dependencies! - No FFI or inline assembly! WASM friendly (and tested)! - `#![no_std]` i.e. embedded-friendly! - No functionality besides securely zeroing memory! - (Optional) Custom derive support for zeroing complex structures ## Minimum Supported Rust Version Requires Rust 1.85 or newer. In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope for this crate's semantic versioning guarantees). ## Example ``` use zeroize::Zeroize; // Protip: don't embed secrets in your source code. // This is just an example. let mut secret = b"Air shield password: 1,2,3,4,5".to_vec(); // [ ... ] open the air shield here // Now that we're done using the secret, zero it out. secret.zeroize(); ``` ## License Licensed under either of: - Apache License, Version 2.0 - MIT license at your option. ### Contribution 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.