@@ -26,6 +26,10 @@ prevent this refinement, the crate tries to hide the value of a `Choice`'s
26
26
inner ` u8 ` by passing it through a volatile read. For more information, see
27
27
the _ About_ section below.
28
28
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
+
29
33
Versions prior to ` 2.2 ` recommended use of the ` nightly ` feature to enable an
30
34
optimization barrier; this is not required in versions ` 2.2 ` and above.
31
35
@@ -48,10 +52,15 @@ Minimum supported Rust version can be changed in the future, but it will be done
48
52
49
53
This library aims to be the Rust equivalent of Go’s ` crypto/subtle ` module.
50
54
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.
55
64
56
65
` subtle ` is authored by isis agora lovecruft and Henry de Valence.
57
66
@@ -66,4 +75,5 @@ effort is fundamentally limited.
66
75
** USE AT YOUR OWN RISK**
67
76
68
77
[ docs ] : https://docs.rs/subtle
78
+ [ `core::hint::black_box` ] : https://doc.rust-lang.org/core/hint/fn.black_box.html
69
79
[ rust-timing-shield ] : https://www.chosenplaintext.ca/open-source/rust-timing-shield/security
0 commit comments