@@ -26,6 +26,10 @@ prevent this refinement, the crate tries to hide the value of a `Choice`'s
2626inner ` u8 ` by passing it through a volatile read. For more information, see
2727the _ About_ section below.
2828
29+ Rust versions from 1.66 or higher support a new best-effort optimization
30+ barrier ([ ` core::hint::black_box ` ] ). To use the new optimization barrier,
31+ enable the ` core_hint_black_box ` feature.
32+
2933Versions prior to ` 2.2 ` recommended use of the ` nightly ` feature to enable an
3034optimization barrier; this is not required in versions ` 2.2 ` and above.
3135
@@ -48,10 +52,15 @@ Minimum supported Rust version can be changed in the future, but it will be done
4852
4953This library aims to be the Rust equivalent of Go’s ` crypto/subtle ` module.
5054
51- The optimization barrier in ` impl From<u8> for Choice ` was based on Tim
52- Maclean's [ work on ` rust-timing-shield ` ] [ rust-timing-shield ] , which attempts to
53- provide a more comprehensive approach for preventing software side-channels in
54- Rust code.
55+ Old versions of the optimization barrier in ` impl From<u8> for Choice ` were
56+ based on Tim Maclean's [ work on ` rust-timing-shield ` ] [ rust-timing-shield ] ,
57+ which attempts to provide a more comprehensive approach for preventing
58+ software side-channels in Rust code.
59+
60+ From version ` 2.2 ` , it was based on Diane Hosfelt and Amber Sprenkels' work on
61+ "Secret Types in Rust". Version ` 2.3 ` adds the ` core_hint_black_box ` feature,
62+ which uses the original method through the [ ` core::hint::black_box ` ] function
63+ from the Rust standard library.
5564
5665` subtle ` is authored by isis agora lovecruft and Henry de Valence.
5766
@@ -66,4 +75,5 @@ effort is fundamentally limited.
6675** USE AT YOUR OWN RISK**
6776
6877[ docs ] : https://docs.rs/subtle
78+ [ `core::hint::black_box` ] : https://doc.rust-lang.org/core/hint/fn.black_box.html
6979[ rust-timing-shield ] : https://www.chosenplaintext.ca/open-source/rust-timing-shield/security
0 commit comments