• Home
  • Raw
  • Download

Lines Matching refs:ffi

61 use std::ffi::CString;
80 pub const RSA: Id = Id(ffi::EVP_PKEY_RSA);
82 pub const HMAC: Id = Id(ffi::EVP_PKEY_HMAC);
84 pub const CMAC: Id = Id(ffi::EVP_PKEY_CMAC);
85 pub const DSA: Id = Id(ffi::EVP_PKEY_DSA);
86 pub const DH: Id = Id(ffi::EVP_PKEY_DH);
87 pub const EC: Id = Id(ffi::EVP_PKEY_EC);
90 pub const HKDF: Id = Id(ffi::EVP_PKEY_HKDF);
93 pub const ED25519: Id = Id(ffi::EVP_PKEY_ED25519);
95 pub const ED448: Id = Id(ffi::EVP_PKEY_ED448);
97 pub const X25519: Id = Id(ffi::EVP_PKEY_X25519);
99 pub const X448: Id = Id(ffi::EVP_PKEY_X448);
133 type CType = ffi::EVP_PKEY;
134 fn drop = ffi::EVP_PKEY_free;
158 let rsa = cvt_p(ffi::EVP_PKEY_get1_RSA(self.as_ptr()))?; in rsa()
167 let dsa = cvt_p(ffi::EVP_PKEY_get1_DSA(self.as_ptr()))?; in dsa()
176 let dh = cvt_p(ffi::EVP_PKEY_get1_DH(self.as_ptr()))?; in dh()
185 let ec_key = cvt_p(ffi::EVP_PKEY_get1_EC_KEY(self.as_ptr()))?; in ec_key()
193 unsafe { Id::from_raw(ffi::EVP_PKEY_id(self.as_ptr())) } in id()
199 unsafe { ffi::EVP_PKEY_size(self.as_ptr()) as usize } in size()
213 ffi::PEM_write_bio_PUBKEY
220 ffi::i2d_PUBKEY
229 unsafe { ffi::EVP_PKEY_bits(self.as_ptr()) as u32 } in bits()
238 unsafe { ffi::EVP_PKEY_security_bits(self.as_ptr()) as u32 } in security_bits()
247 unsafe { ffi::EVP_PKEY_cmp(self.as_ptr(), other.as_ptr()) == 1 } in public_eq()
259 cvt(ffi::EVP_PKEY_get_raw_public_key( in raw_public_key()
265 cvt(ffi::EVP_PKEY_get_raw_public_key( in raw_public_key()
291 ffi::PEM_write_bio_PKCS8PrivateKey
298 ffi::i2d_PrivateKey
310 cvt(ffi::EVP_PKEY_get_raw_private_key( in raw_private_key()
316 cvt(ffi::EVP_PKEY_get_raw_private_key( in raw_private_key()
331 cvt(ffi::i2d_PKCS8PrivateKey_bio( in private_key_to_pkcs8()
361 cvt(ffi::i2d_PKCS8PrivateKey_bio( in private_key_to_pkcs8_passphrase()
407 let evp = cvt_p(ffi::EVP_PKEY_new())?; in from_rsa()
409 cvt(ffi::EVP_PKEY_assign( in from_rsa()
411 ffi::EVP_PKEY_RSA, in from_rsa()
423 let evp = cvt_p(ffi::EVP_PKEY_new())?; in from_dsa()
425 cvt(ffi::EVP_PKEY_assign( in from_dsa()
427 ffi::EVP_PKEY_DSA, in from_dsa()
439 let evp = cvt_p(ffi::EVP_PKEY_new())?; in from_dh()
441 cvt(ffi::EVP_PKEY_assign( in from_dh()
443 ffi::EVP_PKEY_DH, in from_dh()
455 let evp = cvt_p(ffi::EVP_PKEY_new())?; in from_ec_key()
457 cvt(ffi::EVP_PKEY_assign( in from_ec_key()
459 ffi::EVP_PKEY_EC, in from_ec_key()
479 let key = cvt_p(ffi::EVP_PKEY_new_mac_key( in hmac()
480 ffi::EVP_PKEY_HMAC, in hmac()
627 ffi::init(); in ec_gen()
631 let ptr = cvt_p(ffi::EVP_EC_gen(curve.as_ptr()))?; in ec_gen()
651 ffi::PEM_read_bio_PrivateKey
663 ffi::d2i_AutoPrivateKey
671 ffi::init(); in private_key_from_pkcs8()
673 let p8inf = cvt_p(ffi::d2i_PKCS8_PRIV_KEY_INFO( in private_key_from_pkcs8()
678 let res = cvt_p(ffi::EVP_PKCS82PKEY(p8inf)).map(|p| PKey::from_ptr(p)); in private_key_from_pkcs8()
679 ffi::PKCS8_PRIV_KEY_INFO_free(p8inf); in private_key_from_pkcs8()
698 ffi::init(); in private_key_from_pkcs8_callback()
701 cvt_p(ffi::d2i_PKCS8PrivateKey_bio( in private_key_from_pkcs8_callback()
723 ffi::init(); in private_key_from_pkcs8_passphrase()
726 cvt_p(ffi::d2i_PKCS8PrivateKey_bio( in private_key_from_pkcs8_passphrase()
746 ffi::init(); in private_key_from_raw_bytes()
747 cvt_p(ffi::EVP_PKEY_new_raw_private_key( in private_key_from_raw_bytes()
766 ffi::PEM_read_bio_PUBKEY
774 ffi::d2i_PUBKEY
787 ffi::init(); in public_key_from_raw_bytes()
788 cvt_p(ffi::EVP_PKEY_new_raw_public_key( in public_key_from_raw_bytes()
801 use ffi::EVP_PKEY_up_ref;
804 unsafe extern "C" fn EVP_PKEY_up_ref(pkey: *mut ffi::EVP_PKEY) {
805 ffi::CRYPTO_add_lock(
808 ffi::CRYPTO_LOCK_EVP_PKEY,