From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/getrandom-0.1.16/src/fuchsia.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vendor/getrandom-0.1.16/src/fuchsia.rs (limited to 'vendor/getrandom-0.1.16/src/fuchsia.rs') diff --git a/vendor/getrandom-0.1.16/src/fuchsia.rs b/vendor/getrandom-0.1.16/src/fuchsia.rs new file mode 100644 index 000000000..572ff5344 --- /dev/null +++ b/vendor/getrandom-0.1.16/src/fuchsia.rs @@ -0,0 +1,20 @@ +// Copyright 2018 Developers of the Rand project. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Implementation for Fuchsia Zircon +use crate::Error; + +#[link(name = "zircon")] +extern "C" { + fn zx_cprng_draw(buffer: *mut u8, length: usize); +} + +pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> { + unsafe { zx_cprng_draw(dest.as_mut_ptr(), dest.len()) } + Ok(()) +} -- cgit v1.2.3