botan_sys/
utils.rs

1use crate::ffi_types::{c_char, c_int, c_void};
2
3extern "C" {
4
5    pub fn botan_constant_time_compare(x: *const u8, y: *const u8, len: usize) -> c_int;
6
7    pub fn botan_scrub_mem(mem: *mut c_void, bytes: usize) -> c_int;
8
9    pub fn botan_hex_encode(x: *const u8, len: usize, out: *mut c_char, flags: u32) -> c_int;
10
11    pub fn botan_hex_decode(
12        hex_str: *const c_char,
13        in_len: usize,
14        out: *mut u8,
15        out_len: *mut usize,
16    ) -> c_int;
17
18    pub fn botan_base64_encode(
19        x: *const u8,
20        len: usize,
21        out: *mut c_char,
22        out_len: *mut usize,
23    ) -> c_int;
24
25    pub fn botan_base64_decode(
26        base64_str: *const c_char,
27        in_len: usize,
28        out: *mut u8,
29        out_len: *mut usize,
30    ) -> c_int;
31
32}