Loading openssl-sys/src/ec.rs +2 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ extern "C" { ctx: *mut BN_CTX, ) -> c_int; pub fn EC_GROUP_get_curve_name(group: *const EC_GROUP) -> c_int; pub fn EC_GROUP_set_asn1_flag(key: *mut EC_GROUP, flag: c_int); pub fn EC_GROUP_get_curve_GFp( Loading openssl-sys/src/evp.rs +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ pub unsafe fn EVP_get_digestbynid(type_: c_int) -> *const EVP_MD { extern "C" { pub fn EVP_MD_size(md: *const EVP_MD) -> c_int; pub fn EVP_MD_type(md: *const EVP_MD) -> c_int; #[cfg(any(ossl110, libressl273))] pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int; Loading openssl/src/ec.rs +10 −0 Original line number Diff line number Diff line Loading @@ -237,6 +237,16 @@ impl EcGroupRef { ffi::EC_GROUP_set_asn1_flag(self.as_ptr(), flag.0); } } /// Returns the name of the curve, if a name is associated. /// /// OpenSSL documentation at [`EC_GROUP_get_curve_name`] /// /// [`EC_GROUP_get_curve_name`]: https://www.openssl.org/docs/man1.1.0/crypto/EC_GROUP_get_curve_name.html pub fn curve_name(&self) -> Option<Nid> { let nid = unsafe { ffi::EC_GROUP_get_curve_name(self.as_ptr()) }; if nid > 0 { Some(Nid::from_raw(nid)) } else { None } } } foreign_type_and_impl_send_sync! { Loading openssl/src/hash.rs +5 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,11 @@ impl MessageDigest { pub fn size(&self) -> usize { unsafe { ffi::EVP_MD_size(self.0) as usize } } /// The name of the digest pub fn type_(&self) -> Nid { Nid::from_raw(unsafe { ffi::EVP_MD_type(self.0) }) } } unsafe impl Sync for MessageDigest {} Loading Loading
openssl-sys/src/ec.rs +2 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ extern "C" { ctx: *mut BN_CTX, ) -> c_int; pub fn EC_GROUP_get_curve_name(group: *const EC_GROUP) -> c_int; pub fn EC_GROUP_set_asn1_flag(key: *mut EC_GROUP, flag: c_int); pub fn EC_GROUP_get_curve_GFp( Loading
openssl-sys/src/evp.rs +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ pub unsafe fn EVP_get_digestbynid(type_: c_int) -> *const EVP_MD { extern "C" { pub fn EVP_MD_size(md: *const EVP_MD) -> c_int; pub fn EVP_MD_type(md: *const EVP_MD) -> c_int; #[cfg(any(ossl110, libressl273))] pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int; Loading
openssl/src/ec.rs +10 −0 Original line number Diff line number Diff line Loading @@ -237,6 +237,16 @@ impl EcGroupRef { ffi::EC_GROUP_set_asn1_flag(self.as_ptr(), flag.0); } } /// Returns the name of the curve, if a name is associated. /// /// OpenSSL documentation at [`EC_GROUP_get_curve_name`] /// /// [`EC_GROUP_get_curve_name`]: https://www.openssl.org/docs/man1.1.0/crypto/EC_GROUP_get_curve_name.html pub fn curve_name(&self) -> Option<Nid> { let nid = unsafe { ffi::EC_GROUP_get_curve_name(self.as_ptr()) }; if nid > 0 { Some(Nid::from_raw(nid)) } else { None } } } foreign_type_and_impl_send_sync! { Loading
openssl/src/hash.rs +5 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,11 @@ impl MessageDigest { pub fn size(&self) -> usize { unsafe { ffi::EVP_MD_size(self.0) as usize } } /// The name of the digest pub fn type_(&self) -> Nid { Nid::from_raw(unsafe { ffi::EVP_MD_type(self.0) }) } } unsafe impl Sync for MessageDigest {} Loading