Loading openssl-sys/src/evp.rs +5 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,11 @@ cfg_if! { pub unsafe fn EVP_PKEY_bits(pkey: *const EVP_PKEY) -> c_int { EVP_PKEY_get_bits(pkey) } #[inline] pub unsafe fn EVP_PKEY_security_bits(pkey: *const EVP_PKEY) -> c_int { EVP_PKEY_get_security_bits(pkey) } } } Loading openssl/src/pkey.rs +1 −1 Original line number Diff line number Diff line Loading @@ -1030,7 +1030,7 @@ mod tests { fn test_security_bits() { let group = crate::ec::EcGroup::from_curve_name(crate::nid::Nid::SECP521R1).unwrap(); let ec_key = EcKey::generate(&group).unwrap(); let pkey: PKey<Private> = ec_key.clone().try_into().unwrap(); let pkey: PKey<Private> = ec_key.try_into().unwrap(); assert_eq!(pkey.security_bits(), 256); } Loading Loading
openssl-sys/src/evp.rs +5 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,11 @@ cfg_if! { pub unsafe fn EVP_PKEY_bits(pkey: *const EVP_PKEY) -> c_int { EVP_PKEY_get_bits(pkey) } #[inline] pub unsafe fn EVP_PKEY_security_bits(pkey: *const EVP_PKEY) -> c_int { EVP_PKEY_get_security_bits(pkey) } } } Loading
openssl/src/pkey.rs +1 −1 Original line number Diff line number Diff line Loading @@ -1030,7 +1030,7 @@ mod tests { fn test_security_bits() { let group = crate::ec::EcGroup::from_curve_name(crate::nid::Nid::SECP521R1).unwrap(); let ec_key = EcKey::generate(&group).unwrap(); let pkey: PKey<Private> = ec_key.clone().try_into().unwrap(); let pkey: PKey<Private> = ec_key.try_into().unwrap(); assert_eq!(pkey.security_bits(), 256); } Loading