Skip to content

Commit 0744686

Browse files
committed
Update in-library docs with README changes.
1 parent b24e7ea commit 0744686

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/lib.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
//! inner `u8` by passing it through a volatile read. For more information, see
4242
//! the _About_ section below.
4343
//!
44+
//! Rust versions from 1.66 or higher support a new best-effort optimization
45+
//! barrier ([`core::hint::black_box`]). To use the new optimization barrier,
46+
//! enable the `core_hint_black_box` feature.
47+
//!
4448
//! Versions prior to `2.2` recommended use of the `nightly` feature to enable an
4549
//! optimization barrier; this is not required in versions `2.2` and above.
4650
//!
@@ -63,10 +67,15 @@
6367
//!
6468
//! This library aims to be the Rust equivalent of Go’s `crypto/subtle` module.
6569
//!
66-
//! The optimization barrier in `impl From<u8> for Choice` was based on Tim
67-
//! Maclean's [work on `rust-timing-shield`][rust-timing-shield], which attempts to
68-
//! provide a more comprehensive approach for preventing software side-channels in
69-
//! Rust code.
70+
//! Old versions of the optimization barrier in `impl From<u8> for Choice` were
71+
//! based on Tim Maclean's [work on `rust-timing-shield`][rust-timing-shield],
72+
//! which attempts to provide a more comprehensive approach for preventing
73+
//! software side-channels in Rust code.
74+
//!
75+
//! From version `2.2`, it was based on Diane Hosfelt and Amber Sprenkels' work on
76+
//! "Secret Types in Rust". Version `2.5` adds the `core_hint_black_box` feature,
77+
//! which uses the original method through the [`core::hint::black_box`] function
78+
//! from the Rust standard library.
7079
//!
7180
//! `subtle` is authored by isis agora lovecruft and Henry de Valence.
7281
//!
@@ -81,6 +90,7 @@
8190
//! **USE AT YOUR OWN RISK**
8291
//!
8392
//! [docs]: https://docs.rs/subtle
93+
//! [`core::hint::black_box`]: https://doc.rust-lang.org/core/hint/fn.black_box.html
8494
//! [rust-timing-shield]: https://www.chosenplaintext.ca/open-source/rust-timing-shield/security
8595
8696
#[cfg(feature = "std")]

0 commit comments

Comments
 (0)