Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4ae781c

Browse files
committedJun 19, 2024
reword the hint::blackbox non-guarantees
People were tripped up by the "precludes", interpreting it that this function must not ever be used in cryptographic contexts rather than the std lib merely making zero promises about it being fit-for-purpose. What remains unchanged is that if someone does try to use it *despite the warnings* then it is on them to pin their compiler versions and verify the assembly of every single binary build they do.
1 parent 2a5e5b8 commit 4ae781c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎core/src/hint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pub fn spin_loop() {
263263
/// extent to which it can block optimisations may vary depending upon the platform and code-gen
264264
/// backend used. Programs cannot rely on `black_box` for *correctness*, beyond it behaving as the
265265
/// identity function. As such, it **must not be relied upon to control critical program behavior.**
266-
/// This _immediately_ precludes any direct use of this function for cryptographic or security
266+
/// This also means that this function does not offer any guarantees for cryptographic or security
267267
/// purposes.
268268
///
269269
/// [`std::convert::identity`]: crate::convert::identity

0 commit comments

Comments
 (0)
Failed to load comments.