1 use libc::*; 2 3 pub const AES_ENCRYPT: c_int = 1; 4 pub const AES_DECRYPT: c_int = 0; 5 6 pub const AES_MAXNR: c_int = 14; 7 pub const AES_BLOCK_SIZE: c_int = 16; 8 9 #[repr(C)] 10 pub struct AES_KEY { 11 // There is some business with AES_LONG which is there to ensure the values here are 32 bits 12 rd_key: [u32; 4 * (AES_MAXNR as usize + 1)], 13 rounds: c_int, 14 } 15 16 extern "C" { AES_set_encrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int17 pub fn AES_set_encrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int; AES_set_decrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int18 pub fn AES_set_decrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int; 19 AES_ige_encrypt( in_: *const c_uchar, out: *mut c_uchar, length: size_t, key: *const AES_KEY, ivec: *mut c_uchar, enc: c_int, )20 pub fn AES_ige_encrypt( 21 in_: *const c_uchar, 22 out: *mut c_uchar, 23 length: size_t, 24 key: *const AES_KEY, 25 ivec: *mut c_uchar, 26 enc: c_int, 27 ); 28 AES_wrap_key( key: *mut AES_KEY, iv: *const c_uchar, out: *mut c_uchar, in_: *const c_uchar, inlen: c_uint, ) -> c_int29 pub fn AES_wrap_key( 30 key: *mut AES_KEY, 31 iv: *const c_uchar, 32 out: *mut c_uchar, 33 in_: *const c_uchar, 34 inlen: c_uint, 35 ) -> c_int; 36 AES_unwrap_key( key: *mut AES_KEY, iv: *const c_uchar, out: *mut c_uchar, in_: *const c_uchar, inlen: c_uint, ) -> c_int37 pub fn AES_unwrap_key( 38 key: *mut AES_KEY, 39 iv: *const c_uchar, 40 out: *mut c_uchar, 41 in_: *const c_uchar, 42 inlen: c_uint, 43 ) -> c_int; 44 } 45