diff options
Diffstat (limited to 'ffi/src/openpgp/crypto.rs')
-rw-r--r-- | ffi/src/openpgp/crypto.rs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/ffi/src/openpgp/crypto.rs b/ffi/src/openpgp/crypto.rs deleted file mode 100644 index 5b695ec7..00000000 --- a/ffi/src/openpgp/crypto.rs +++ /dev/null @@ -1,54 +0,0 @@ -//! Cryptographic primitives. -//! -//! Wraps [`sequoia-openpgp::crypto`]. -//! -//! [`sequoia-openpgp::crypto`]: ../../../sequoia_openpgp/crypto/index.html - -extern crate sequoia_openpgp; -use self::sequoia_openpgp::{ - crypto, - packet::Key, -}; - -/// Frees a signer. -#[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn sq_signer_free - (s: Option<&mut &'static mut crypto::Signer>) -{ - ffi_free!(s) -} - -/// Creates a new key pair. -#[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn sq_key_pair_new - (errp: Option<&mut *mut failure::Error>, public: *mut Key, secret: *mut crypto::mpis::SecretKey) - -> *mut crypto::KeyPair -{ - ffi_make_fry_from_errp!(errp); - let public = ffi_param_move!(public); - let secret = ffi_param_move!(secret); - ffi_try_box!(crypto::KeyPair::new(*public, *secret)) -} - -/// Frees a key pair. -#[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn sq_key_pair_free - (kp: Option<&mut crypto::KeyPair>) -{ - ffi_free!(kp) -} - -/// Creates a signer from a key pair. -/// -/// Note that the returned object merely references the key pair, and -/// must not outlive the key pair. -#[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn sq_key_pair_as_signer - (kp: *mut crypto::KeyPair) - -> *mut &'static mut crypto::Signer -{ - let kp = ffi_param_ref_mut!(kp); - let signer: &mut crypto::Signer = kp; - box_raw!(signer) - //box_raw!(kp) -} |