diff --git a/src/ffi.rs b/src/ffi.rs index 0085f18..01a8530 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -41,8 +41,9 @@ pub type NonceFn = unsafe extern "C" fn(nonce32: *mut c_uchar, msg32: *const c_uchar, key32: *const c_uchar, algo16: *const c_uchar, + data: *mut c_void, attempt: c_uint, - data: *const c_void); +); /// Hash function to use to post-process an ECDH point to get /// a shared secret. @@ -50,7 +51,7 @@ pub type EcdhHashFn = unsafe extern "C" fn( output: *mut c_uchar, x: *const c_uchar, y: *const c_uchar, - data: *const c_void, + data: *mut c_void, ); /// A Secp256k1 context, containing various precomputed values and such @@ -186,7 +187,7 @@ extern "C" { out_len: *mut usize, sig: *const Signature) -> c_int; - pub fn secp256k1_ecdsa_signature_serialize_compact(cx: *const Context, output64: *const c_uchar, + pub fn secp256k1_ecdsa_signature_serialize_compact(cx: *const Context, output64: *mut c_uchar, sig: *const Signature) -> c_int; diff --git a/src/recovery/ffi.rs b/src/recovery/ffi.rs index 6b6e1f9..5a84b46 100644 --- a/src/recovery/ffi.rs +++ b/src/recovery/ffi.rs @@ -45,7 +45,7 @@ extern "C" { input64: *const c_uchar, recid: c_int) -> c_int; - pub fn secp256k1_ecdsa_recoverable_signature_serialize_compact(cx: *const Context, output64: *const c_uchar, + pub fn secp256k1_ecdsa_recoverable_signature_serialize_compact(cx: *const Context, output64: *mut c_uchar, recid: *mut c_int, sig: *const RecoverableSignature) -> c_int; @@ -82,7 +82,7 @@ mod fuzz_dummy { unimplemented!(); } - pub unsafe fn secp256k1_ecdsa_recoverable_signature_serialize_compact(_cx: *const Context, _output64: *const c_uchar, + pub unsafe fn secp256k1_ecdsa_recoverable_signature_serialize_compact(_cx: *const Context, _output64: *mut c_uchar, _recid: *mut c_int, _sig: *const RecoverableSignature) -> c_int { unimplemented!(); diff --git a/src/types.rs b/src/types.rs index 3e79cac..f0e761b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -23,4 +23,19 @@ impl fmt::Debug for c_void { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.pad("c_void") } +} + +#[cfg(test)] +mod tests { + use std::os::raw; + use std::any::TypeId; + use types; + + #[test] + fn verify_types() { + assert_eq!(TypeId::of::(), TypeId::of::()); + assert_eq!(TypeId::of::(), TypeId::of::()); + assert_eq!(TypeId::of::(), TypeId::of::()); + assert_eq!(TypeId::of::(), TypeId::of::()); + } } \ No newline at end of file