Skip to content

Commit 350df46

Browse files
authored
Rename getrandom(_uninit) to fill(_uninit) (#532)
The new names are shorter and easier to understand (i.e. compare `getrandom::fill` vs `getrandom::getrandom`).
1 parent 573f855 commit 350df46

27 files changed

+80
-67
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88

99
### Breaking Changes
10-
- Update MSRV to 1.60 [#472]
10+
11+
#### Changed
12+
- Bump MSRV to 1.60 [#472]
13+
- Rename `getrandom` and `getrandom_uninit` functions to `fill` and `fill_uninit` respectively [#532]
1114

1215
#### Removed
1316
- `wasm32-wasi` target support (use `wasm32-wasip1` or `wasm32-wasip2` instead) [#499]
@@ -46,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4649
[#520]: https://github.com/rust-random/getrandom/pull/520
4750
[#521]: https://github.com/rust-random/getrandom/pull/521
4851
[#522]: https://github.com/rust-random/getrandom/pull/522
52+
[#532]: https://github.com/rust-random/getrandom/pull/532
4953

5054
## [0.2.15] - 2024-05-06
5155
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Then invoke the `getrandom` function:
4040
```rust
4141
fn get_random_buf() -> Result<[u8; 32], getrandom::Error> {
4242
let mut buf = [0u8; 32];
43-
getrandom::getrandom(&mut buf)?;
43+
getrandom::fill(&mut buf)?;
4444
Ok(buf)
4545
}
4646
```

benches/buffer.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ use std::mem::MaybeUninit;
55

66
// Call getrandom on a zero-initialized stack buffer
77
#[inline(always)]
8-
fn bench_getrandom<const N: usize>() {
8+
fn bench_fill<const N: usize>() {
99
let mut buf = [0u8; N];
10-
getrandom::getrandom(&mut buf).unwrap();
10+
getrandom::fill(&mut buf).unwrap();
1111
test::black_box(&buf[..]);
1212
}
1313

14-
// Call getrandom_uninit on an uninitialized stack buffer
14+
// Call fill_uninit on an uninitialized stack buffer
1515
#[inline(always)]
16-
fn bench_getrandom_uninit<const N: usize>() {
16+
fn bench_fill_uninit<const N: usize>() {
1717
let mut uninit = [MaybeUninit::uninit(); N];
18-
let buf: &[u8] = getrandom::getrandom_uninit(&mut uninit).unwrap();
18+
let buf: &[u8] = getrandom::fill_uninit(&mut uninit).unwrap();
1919
test::black_box(buf);
2020
}
2121

@@ -30,20 +30,20 @@ macro_rules! bench {
3030
( $name:ident, $size:expr ) => {
3131
pub mod $name {
3232
#[bench]
33-
pub fn bench_getrandom(b: &mut test::Bencher) {
33+
pub fn bench_fill(b: &mut test::Bencher) {
3434
#[inline(never)]
3535
fn inner() {
36-
super::bench_getrandom::<{ $size }>()
36+
super::bench_fill::<{ $size }>()
3737
}
3838

3939
b.bytes = $size as u64;
4040
b.iter(inner);
4141
}
4242
#[bench]
43-
pub fn bench_getrandom_uninit(b: &mut test::Bencher) {
43+
pub fn bench_fill_uninit(b: &mut test::Bencher) {
4444
#[inline(never)]
4545
fn inner() {
46-
super::bench_getrandom_uninit::<{ $size }>()
46+
super::bench_fill_uninit::<{ $size }>()
4747
}
4848

4949
b.bytes = $size as u64;

nopanic_check/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
1313
#[no_mangle]
1414
pub extern "C" fn getrandom_wrapper(buf_ptr: *mut u8, buf_len: usize) -> u32 {
1515
let buf = unsafe { core::slice::from_raw_parts_mut(buf_ptr.cast(), buf_len) };
16-
let res = getrandom::getrandom_uninit(buf).map(|_| ());
16+
let res = getrandom::fill_uninit(buf).map(|_| ());
1717
unsafe { core::mem::transmute(res) }
1818
}
1919

src/apple-other.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use crate::Error;
33
use core::{ffi::c_void, mem::MaybeUninit};
44

5-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
5+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
66
let dst_ptr = dest.as_mut_ptr().cast::<c_void>();
77
let ret = unsafe { libc::CCRandomGenerateBytes(dst_ptr, dest.len()) };
88
if ret == libc::kCCSuccess {

src/custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use crate::Error;
33
use core::mem::MaybeUninit;
44

5-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
5+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
66
extern "Rust" {
77
fn __getrandom_v03_custom(dest: *mut u8, len: usize) -> Result<(), Error>;
88
}

src/esp_idf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern "C" {
99
fn esp_fill_random(buf: *mut c_void, len: usize) -> u32;
1010
}
1111

12-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
12+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1313
// Not that NOT enabling WiFi, BT, or the voltage noise entropy source (via `bootloader_random_enable`)
1414
// will cause ESP-IDF to return pseudo-random numbers based on the voltage noise entropy, after the initial boot process:
1515
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/random.html

src/fuchsia.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern "C" {
77
fn zx_cprng_draw(buffer: *mut u8, length: usize);
88
}
99

10-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
10+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1111
unsafe { zx_cprng_draw(dest.as_mut_ptr().cast::<u8>(), dest.len()) }
1212
Ok(())
1313
}

src/getentropy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use crate::{util_libc::last_os_error, Error};
1111
use core::{ffi::c_void, mem::MaybeUninit};
1212

13-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
13+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1414
for chunk in dest.chunks_mut(256) {
1515
let ret = unsafe { libc::getentropy(chunk.as_mut_ptr().cast::<c_void>(), chunk.len()) };
1616
if ret != 0 {

src/getrandom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use crate::{util_libc::sys_fill_exact, Error};
1919
use core::{ffi::c_void, mem::MaybeUninit};
2020

21-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
21+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
2222
sys_fill_exact(dest, |buf| unsafe {
2323
libc::getrandom(buf.as_mut_ptr().cast::<c_void>(), buf.len(), 0)
2424
})

src/hermit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern "C" {
66
fn sys_read_entropy(buffer: *mut u8, length: usize, flags: u32) -> isize;
77
}
88

9-
pub fn getrandom_inner(mut dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
9+
pub fn fill_inner(mut dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1010
while !dest.is_empty() {
1111
let res = unsafe { sys_read_entropy(dest.as_mut_ptr().cast::<u8>(), dest.len(), 0) };
1212
match res {

src/lib.rs

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@
213213
//!
214214
//! ## Sanitizer support
215215
//!
216-
//! If your code uses `getrandom_uninit` and you use memory sanitizer
216+
//! If your code uses [`fill_uninit`] and you use memory sanitizer
217217
//! (i.e. `-Zsanitizer=memory`), then you need to pass `getrandom_sanitize`
218-
//! configuration flag for `getrandom_uninit` to unpoison destination buffer.
218+
//! configuration flag for `fill_uninit` to unpoison destination buffer.
219219
//!
220220
//! For example, it can be done like this (requires Nightly compiler):
221221
//! ```text
@@ -304,8 +304,8 @@ use crate::util::{slice_as_uninit_mut, slice_assume_init_mut};
304304

305305
// System-specific implementations.
306306
//
307-
// These should all provide getrandom_inner with the signature
308-
// `fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error>`.
307+
// These should all provide fill_inner with the signature
308+
// `fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error>`.
309309
// The function MUST fully initialize `dest` when `Ok(())` is returned.
310310
// The function MUST NOT ever write uninitialized bytes into `dest`,
311311
// regardless of what value it returns.
@@ -442,8 +442,7 @@ cfg_if! {
442442
}
443443
}
444444

445-
/// Fill `dest` with random bytes from the system's preferred random number
446-
/// source.
445+
/// Fill `dest` with random bytes from the system's preferred random number source.
447446
///
448447
/// This function returns an error on any failure, including partial reads. We
449448
/// make no guarantees regarding the contents of `dest` on error. If `dest` is
@@ -455,17 +454,27 @@ cfg_if! {
455454
/// In general, `getrandom` will be fast enough for interactive usage, though
456455
/// significantly slower than a user-space CSPRNG; for the latter consider
457456
/// [`rand::thread_rng`](https://docs.rs/rand/*/rand/fn.thread_rng.html).
457+
///
458+
/// # Examples
459+
///
460+
/// ```
461+
/// # fn main() -> Result<(), getrandom::Error> {
462+
/// let mut buf = [0u8; 32];
463+
/// getrandom::fill(&mut buf)?;
464+
/// # Ok(()) }
465+
/// ```
458466
#[inline]
459-
pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {
460-
// SAFETY: The `&mut MaybeUninit<_>` reference doesn't escape, and
461-
// `getrandom_uninit` guarantees it will never de-initialize any part of
462-
// `dest`.
463-
getrandom_uninit(unsafe { slice_as_uninit_mut(dest) })?;
467+
pub fn fill(dest: &mut [u8]) -> Result<(), Error> {
468+
// SAFETY: The `&mut MaybeUninit<_>` reference doesn't escape,
469+
// and `fill_uninit` guarantees it will never de-initialize
470+
// any part of `dest`.
471+
fill_uninit(unsafe { slice_as_uninit_mut(dest) })?;
464472
Ok(())
465473
}
466474

467-
/// Version of the `getrandom` function which fills `dest` with random bytes
468-
/// returns a mutable reference to those bytes.
475+
/// Fill potentially uninitialized buffer `dest` with random bytes from
476+
/// the system's preferred random number source and return a mutable
477+
/// reference to those bytes.
469478
///
470479
/// On successful completion this function is guaranteed to return a slice
471480
/// which points to the same memory as `dest` and has the same length.
@@ -482,13 +491,13 @@ pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {
482491
/// #![feature(maybe_uninit_uninit_array)]
483492
/// # fn main() -> Result<(), getrandom::Error> {
484493
/// let mut buf = core::mem::MaybeUninit::uninit_array::<1024>();
485-
/// let buf: &mut [u8] = getrandom::getrandom_uninit(&mut buf)?;
494+
/// let buf: &mut [u8] = getrandom::fill_uninit(&mut buf)?;
486495
/// # Ok(()) }
487496
/// ```
488497
#[inline]
489-
pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error> {
498+
pub fn fill_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error> {
490499
if !dest.is_empty() {
491-
imp::getrandom_inner(dest)?;
500+
imp::fill_inner(dest)?;
492501
}
493502

494503
#[cfg(getrandom_sanitize)]
@@ -497,7 +506,7 @@ pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error
497506
fn __msan_unpoison(a: *mut core::ffi::c_void, size: usize);
498507
}
499508

500-
// SAFETY: `dest` has been fully initialized by `imp::getrandom_inner`
509+
// SAFETY: `dest` has been fully initialized by `imp::fill_inner`
501510
// since it returned `Ok`.
502511
Ok(unsafe {
503512
#[cfg(getrandom_sanitize)]

src/linux_android.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::mem::MaybeUninit;
55
#[cfg(not(any(target_os = "android", target_os = "linux")))]
66
compile_error!("`linux_getrandom` backend can be enabled only for Linux/Android targets!");
77

8-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
8+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
99
util_libc::sys_fill_exact(dest, |buf| unsafe {
1010
libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0)
1111
})

src/linux_android_with_fallback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ fn init() -> NonNull<c_void> {
5252
// prevent inlining of the fallback implementation
5353
#[inline(never)]
5454
fn use_file_fallback(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
55-
use_file::getrandom_inner(dest)
55+
use_file::fill_inner(dest)
5656
}
5757

58-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
58+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
5959
// Despite being only a single atomic variable, we still cannot always use
6060
// Ordering::Relaxed, as we need to make sure a successful call to `init`
6161
// is "ordered before" any data read through the returned pointer (which

src/linux_rustix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustix::rand::{getrandom_uninit, GetRandomFlags};
55
#[cfg(not(any(target_os = "android", target_os = "linux")))]
66
compile_error!("`linux_rustix` backend can be enabled only for Linux/Android targets!");
77

8-
pub fn getrandom_inner(mut dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
8+
pub fn fill_inner(mut dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
99
loop {
1010
let res = getrandom_uninit(dest, GetRandomFlags::empty()).map(|(res, _)| res.len());
1111
match res {

src/netbsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn init() -> *mut c_void {
5757
ptr
5858
}
5959

60-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
60+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
6161
// Despite being only a single atomic variable, we still cannot always use
6262
// Ordering::Relaxed, as we need to make sure a successful call to `init`
6363
// is "ordered before" any data read through the returned pointer (which

src/rdrand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn is_rdrand_good() -> bool {
9696
unsafe { self_test() }
9797
}
9898

99-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
99+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
100100
static RDRAND_GOOD: LazyBool = LazyBool::new();
101101
if !RDRAND_GOOD.unsync_init(is_rdrand_good) {
102102
return Err(Error::NO_RDRAND);

src/rndr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn is_rndr_available() -> bool {
101101
}
102102
}
103103

104-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
104+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
105105
if is_rndr_available() {
106106
// SAFETY: after this point, we know the `rand` target feature is enabled
107107
unsafe { rndr_fill(dest).ok_or(Error::RNDR_FAILURE) }

src/solaris.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use core::{ffi::c_void, mem::MaybeUninit};
1717

1818
const MAX_BYTES: usize = 1024;
1919

20-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
20+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
2121
for chunk in dest.chunks_mut(MAX_BYTES) {
2222
let ptr = chunk.as_mut_ptr().cast::<c_void>();
2323
let ret = unsafe { libc::getrandom(ptr, chunk.len(), libc::GRND_RANDOM) };

src/solid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern "C" {
66
pub fn SOLID_RNG_SampleRandomBytes(buffer: *mut u8, length: usize) -> i32;
77
}
88

9-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
9+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1010
let ret = unsafe { SOLID_RNG_SampleRandomBytes(dest.as_mut_ptr().cast::<u8>(), dest.len()) };
1111
if ret >= 0 {
1212
Ok(())

src/use_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const FD_ONGOING_INIT: libc::c_int = -2;
3737
// `Ordering::Acquire` to synchronize with it.
3838
static FD: AtomicI32 = AtomicI32::new(FD_UNINIT);
3939

40-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
40+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
4141
let mut fd = FD.load(Ordering::Acquire);
4242
if fd == FD_UNINIT || fd == FD_ONGOING_INIT {
4343
fd = open_or_wait()?;

src/vxworks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::{
66
sync::atomic::{AtomicBool, Ordering::Relaxed},
77
};
88

9-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
9+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1010
static RNG_INIT: AtomicBool = AtomicBool::new(false);
1111
while !RNG_INIT.load(Relaxed) {
1212
let ret = unsafe { libc::randSecure() };

src/wasi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ compile_error!(
1212
);
1313

1414
#[cfg(target_env = "p1")]
15-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
15+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1616
// This linking is vendored from the wasi crate:
1717
// https://docs.rs/wasi/0.11.0+wasi-snapshot-preview1/src/wasi/lib_generated.rs.html#2344-2350
1818
#[link(wasm_import_module = "wasi_snapshot_preview1")]
@@ -38,7 +38,7 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
3838
}
3939

4040
#[cfg(target_env = "p2")]
41-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
41+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
4242
use core::ptr::copy_nonoverlapping;
4343
use wasi::random::random::get_random_u64;
4444

src/wasm_js.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ thread_local!(
3030
static RNG_SOURCE: Result<RngSource, Error> = getrandom_init();
3131
);
3232

33-
pub(crate) fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
33+
pub(crate) fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
3434
RNG_SOURCE.with(|result| {
3535
let source = result.as_ref().map_err(|&e| e)?;
3636

src/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ windows_targets::link!("bcryptprimitives.dll" "system" fn ProcessPrng(pbdata: *m
3131
pub type BOOL = i32;
3232
pub const TRUE: BOOL = 1i32;
3333

34-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
34+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
3535
// ProcessPrng should always return TRUE, but we check just in case.
3636
match unsafe { ProcessPrng(dest.as_mut_ptr().cast::<u8>(), dest.len()) } {
3737
TRUE => Ok(()),

src/windows7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "system" {
2323
type BOOLEAN = u8;
2424
const TRUE: BOOLEAN = 1u8;
2525

26-
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
26+
pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
2727
// Prevent overflow of u32
2828
let chunk_size = usize::try_from(i32::MAX).expect("Windows does not support 16-bit targets");
2929
for chunk in dest.chunks_mut(chunk_size) {

0 commit comments

Comments
 (0)