Skip to content

Commit 9a0c18c

Browse files
authored
windows: tweak comment about ProcessPrng (#743)
1 parent 065abc8 commit 9a0c18c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/backends/windows.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@ const TRUE: BOOL = 1;
5151
#[inline]
5252
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
5353
let result = unsafe { ProcessPrng(dest.as_mut_ptr().cast::<u8>(), dest.len()) };
54-
// Since Windows 10, calls to the user-mode RNG are guaranteed to never
55-
// fail during runtime (rare windows W); `ProcessPrng` will only ever
56-
// return 1 (which is how windows represents TRUE).
57-
// See the bottom of page 6 of the aforementioned Windows RNG
58-
// whitepaper for more information.
54+
// `ProcessPrng` is documented to always return TRUE. All potential errors are handled
55+
// during loading of `BCryptPrimitive.dll`. See the "Process base PRNG" section
56+
// in the aforementioned Windows RNG whitepaper for more information.
5957
debug_assert!(result == TRUE);
6058
Ok(())
6159
}

0 commit comments

Comments
 (0)