1use crate::ffi_types::{c_char, c_int, c_void};
2
3pub enum botan_rng_struct {}
4pub type botan_rng_t = *mut botan_rng_struct;
5
6unsafe extern "C" {
7
8 pub fn botan_rng_init(rng: *mut botan_rng_t, rng_type: *const c_char) -> c_int;
9
10 #[cfg(botan_ffi_20230403)]
11 pub fn botan_rng_init_custom(
12 rng_out: *mut botan_rng_t,
13 rng_name: *const c_char,
14 context: *mut c_void,
15 get_cb: Option<extern "C" fn(context: *mut c_void, out: *mut u8, out_len: usize) -> c_int>,
16 add_entropy_cb: Option<
17 extern "C" fn(context: *mut c_void, input: *const u8, length: usize) -> c_int,
18 >,
19 destroy_cb: Option<extern "C" fn(context: *mut c_void)>,
20 ) -> c_int;
21
22 pub fn botan_rng_get(rng: botan_rng_t, out: *mut u8, out_len: usize) -> c_int;
23
24 #[cfg(botan_ffi_20230403)]
25 pub fn botan_system_rng_get(out: *mut u8, out_len: usize) -> c_int;
26
27 pub fn botan_rng_reseed(rng: botan_rng_t, bits: usize) -> c_int;
28
29 pub fn botan_rng_reseed_from_rng(rng: botan_rng_t, src: botan_rng_t, bits: usize) -> c_int;
30
31 pub fn botan_rng_add_entropy(rng: botan_rng_t, data: *const u8, len: usize) -> c_int;
32
33 #[cfg(botan_ffi_20260506)]
34 pub fn botan_rng_init_drbg(
35 rng_out: *mut botan_rng_t,
36 drbg_name: *const c_char,
37 seed: *const u8,
38 seed_len: usize,
39 ) -> c_int;
40
41 #[cfg(botan_ffi_20260506)]
42 pub fn botan_rng_generate_with_input(
43 rng: botan_rng_t,
44 out: *mut u8,
45 out_len: usize,
46 addl_input: *const u8,
47 addl_len: usize,
48 ) -> c_int;
49
50 pub fn botan_rng_destroy(rng: botan_rng_t) -> c_int;
51
52}