1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use crate::ffi_types::{c_char, c_int};

pub enum botan_block_cipher_struct {}
pub type botan_block_cipher_t = *mut botan_block_cipher_struct;

extern "C" {

    pub fn botan_block_cipher_init(
        bc: *mut botan_block_cipher_t,
        cipher_name: *const c_char,
    ) -> c_int;

    pub fn botan_block_cipher_destroy(bc: botan_block_cipher_t) -> c_int;

    pub fn botan_block_cipher_name(
        bc: botan_block_cipher_t,
        name: *mut c_char,
        name_len: *mut usize,
    ) -> c_int;

    pub fn botan_block_cipher_get_keyspec(
        bc: botan_block_cipher_t,
        min_keylen: *mut usize,
        max_keylen: *mut usize,
        mod_keylen: *mut usize,
    ) -> c_int;

    pub fn botan_block_cipher_clear(bc: botan_block_cipher_t) -> c_int;

    pub fn botan_block_cipher_set_key(
        bc: botan_block_cipher_t,
        key: *const u8,
        len: usize,
    ) -> c_int;

    pub fn botan_block_cipher_block_size(bc: botan_block_cipher_t) -> c_int;

    pub fn botan_block_cipher_encrypt_blocks(
        bc: botan_block_cipher_t,
        input: *const u8,
        output: *mut u8,
        blocks: usize,
    ) -> c_int;

    pub fn botan_block_cipher_decrypt_blocks(
        bc: botan_block_cipher_t,
        input: *const u8,
        output: *mut u8,
        blocks: usize,
    ) -> c_int;

}