Skip to content

Commit

Permalink
Rollup merge of rust-lang#126703 - the8472:on-blackbox-crypto-use, r=…
Browse files Browse the repository at this point in the history
…scottmcm

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.
  • Loading branch information
matthiaskrgr authored Jun 20, 2024
2 parents dd7c901 + 4ae781c commit b6a3858
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ pub fn spin_loop() {
/// extent to which it can block optimisations may vary depending upon the platform and code-gen
/// backend used. Programs cannot rely on `black_box` for *correctness*, beyond it behaving as the
/// identity function. As such, it **must not be relied upon to control critical program behavior.**
/// This _immediately_ precludes any direct use of this function for cryptographic or security
/// This also means that this function does not offer any guarantees for cryptographic or security
/// purposes.
///
/// [`std::convert::identity`]: crate::convert::identity
Expand Down

0 comments on commit b6a3858

Please sign in to comment.