From 9143516037d725f8960b9610dfb037786711b968 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 16 Aug 2017 21:03:33 -0700 Subject: Add SHA384 and SHA512 --- openssl-sys/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 9103715a..3617229b 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -151,6 +151,17 @@ pub struct SHA256_CTX { pub md_len: c_uint, } +#[repr(C)] +pub struct SHA512_CTX { + pub h: [SHA_LONG64; 8], + pub Nl: SHA_LONG64, + pub Nh: SHA_LONG64, + // this is a union but we don't want to require 1.19 + u: [SHA_LONG64; SHA_LBLOCK as usize], + pub num: c_uint, + pub md_len: c_uint, +} + #[cfg(target_pointer_width = "64")] pub type BN_ULONG = libc::c_ulonglong; #[cfg(target_pointer_width = "32")] @@ -183,6 +194,7 @@ pub type PasswordCallback = unsafe extern "C" fn(buf: *mut c_char, -> c_int; pub type SHA_LONG = c_uint; +pub type SHA_LONG64 = u64; pub const AES_ENCRYPT: c_int = 1; pub const AES_DECRYPT: c_int = 0; @@ -2257,6 +2269,12 @@ extern "C" { pub fn SHA224_Init(c: *mut SHA256_CTX) -> c_int; pub fn SHA224_Update(c: *mut SHA256_CTX, data: *const c_void, len: size_t) -> c_int; pub fn SHA224_Final(md: *mut c_uchar, c: *mut SHA256_CTX) -> c_int; + pub fn SHA384_Init(c: *mut SHA512_CTX) -> c_int; + pub fn SHA384_Update(c: *mut SHA512_CTX, data: *const c_void, len: size_t) -> c_int; + pub fn SHA384_Final(md: *mut c_uchar, c: *mut SHA512_CTX) -> c_int; + pub fn SHA512_Init(c: *mut SHA512_CTX) -> c_int; + pub fn SHA512_Update(c: *mut SHA512_CTX, data: *const c_void, len: size_t) -> c_int; + pub fn SHA512_Final(md: *mut c_uchar, c: *mut SHA512_CTX) -> c_int; pub fn SSL_new(ctx: *mut SSL_CTX) -> *mut SSL; pub fn SSL_pending(ssl: *const SSL) -> c_int; -- cgit v1.2.3