|
| 1 | +// Copyright 2023 Contributors to the Parsec project. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +pub const OSSL_PROV_PARAM_NAME: &[u8; 5] = b"name\0"; |
| 5 | +pub const OSSL_PROV_PARAM_VERSION: &[u8; 8] = b"version\0"; |
| 6 | +pub const OSSL_PROV_PARAM_BUILDINFO: &[u8; 10] = b"buildinfo\0"; |
| 7 | +pub const OSSL_PROV_PARAM_STATUS: &[u8; 7] = b"status\0"; |
| 8 | +pub const OSSL_PARAM_UTF8_PTR: u32 = 6; |
| 9 | +pub const OSSL_PARAM_INTEGER: u32 = 1; |
| 10 | + |
| 11 | +pub const OSSL_FUNC_PROVIDER_TEARDOWN: i32 = 1024; |
| 12 | +pub const OSSL_FUNC_PROVIDER_GETTABLE_PARAMS: i32 = 1025; |
| 13 | +pub const OSSL_FUNC_PROVIDER_GET_PARAMS: i32 = 1026; |
| 14 | +pub const OSSL_FUNC_PROVIDER_QUERY_OPERATION: i32 = 1027; |
| 15 | +pub const OSSL_FUNC_PROVIDER_UNQUERY_OPERATION: i32 = 1028; |
| 16 | +pub const OSSL_FUNC_PROVIDER_GET_REASON_STRINGS: i32 = 1029; |
| 17 | +pub const OSSL_FUNC_PROVIDER_GET_CAPABILITIES: i32 = 1030; |
| 18 | + |
| 19 | +#[repr(C)] |
| 20 | +#[derive(Debug, Copy, Clone)] |
| 21 | +pub struct ossl_core_handle_st { |
| 22 | + _unused: [u8; 0], |
| 23 | +} |
| 24 | +pub type OSSL_CORE_HANDLE = ossl_core_handle_st; |
| 25 | + |
| 26 | +#[repr(C)] |
| 27 | +#[derive(Debug, Copy, Clone)] |
| 28 | +pub struct ossl_dispatch_st { |
| 29 | + pub function_id: ::std::os::raw::c_int, |
| 30 | + pub function: ::std::option::Option<fn()>, |
| 31 | +} |
| 32 | + |
| 33 | +pub type OSSL_DISPATCH = ossl_dispatch_st; |
| 34 | + |
| 35 | +#[repr(C)] |
| 36 | +#[derive(Debug, Copy, Clone)] |
| 37 | +pub struct ossl_param_st { |
| 38 | + pub key: *const ::std::os::raw::c_char, |
| 39 | + pub data_type: ::std::os::raw::c_uint, |
| 40 | + pub data: *mut ::std::os::raw::c_void, |
| 41 | + pub data_size: usize, |
| 42 | + pub return_size: usize, |
| 43 | +} |
| 44 | + |
| 45 | +pub type OSSL_PARAM = ossl_param_st; |
| 46 | + |
| 47 | +#[repr(C)] |
| 48 | +#[derive(Debug, Copy, Clone)] |
| 49 | +pub struct ossl_algorithm_st { |
| 50 | + pub algorithm_names: *const ::std::os::raw::c_char, |
| 51 | + pub property_definition: *const ::std::os::raw::c_char, |
| 52 | + pub implementation: *const OSSL_DISPATCH, |
| 53 | + pub algorithm_description: *const ::std::os::raw::c_char, |
| 54 | +} |
| 55 | + |
| 56 | +pub type OSSL_ALGORITHM = ossl_algorithm_st; |
| 57 | + |
| 58 | +extern "C" { |
| 59 | + pub fn OSSL_PARAM_locate( |
| 60 | + p: *mut OSSL_PARAM, |
| 61 | + key: *const ::std::os::raw::c_char, |
| 62 | + ) -> *mut OSSL_PARAM; |
| 63 | + |
| 64 | + pub fn OSSL_PARAM_set_utf8_ptr( |
| 65 | + p: *mut OSSL_PARAM, |
| 66 | + val: *const ::std::os::raw::c_char, |
| 67 | + ) -> ::std::os::raw::c_int; |
| 68 | + |
| 69 | + pub fn OSSL_PARAM_set_int( |
| 70 | + p: *mut OSSL_PARAM, |
| 71 | + val: ::std::os::raw::c_int, |
| 72 | + ) -> ::std::os::raw::c_int; |
| 73 | +} |
0 commit comments