File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,17 @@ pub type NonceFn = unsafe extern "C" fn(nonce32: *mut c_uchar,
4141 msg32 : * const c_uchar ,
4242 key32 : * const c_uchar ,
4343 algo16 : * const c_uchar ,
44+ data : * mut c_void ,
4445 attempt : c_uint ,
45- data : * const c_void ) ;
46+ ) ;
4647
4748/// Hash function to use to post-process an ECDH point to get
4849/// a shared secret.
4950pub type EcdhHashFn = unsafe extern "C" fn (
5051 output : * mut c_uchar ,
5152 x : * const c_uchar ,
5253 y : * const c_uchar ,
53- data : * const c_void ,
54+ data : * mut c_void ,
5455) ;
5556
5657/// A Secp256k1 context, containing various precomputed values and such
@@ -186,7 +187,7 @@ extern "C" {
186187 out_len : * mut usize , sig : * const Signature )
187188 -> c_int ;
188189
189- pub fn secp256k1_ecdsa_signature_serialize_compact ( cx : * const Context , output64 : * const c_uchar ,
190+ pub fn secp256k1_ecdsa_signature_serialize_compact ( cx : * const Context , output64 : * mut c_uchar ,
190191 sig : * const Signature )
191192 -> c_int ;
192193
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ extern "C" {
4545 input64 : * const c_uchar , recid : c_int )
4646 -> c_int ;
4747
48- pub fn secp256k1_ecdsa_recoverable_signature_serialize_compact ( cx : * const Context , output64 : * const c_uchar ,
48+ pub fn secp256k1_ecdsa_recoverable_signature_serialize_compact ( cx : * const Context , output64 : * mut c_uchar ,
4949 recid : * mut c_int , sig : * const RecoverableSignature )
5050 -> c_int ;
5151
@@ -82,7 +82,7 @@ mod fuzz_dummy {
8282 unimplemented ! ( ) ;
8383 }
8484
85- pub unsafe fn secp256k1_ecdsa_recoverable_signature_serialize_compact ( _cx : * const Context , _output64 : * const c_uchar ,
85+ pub unsafe fn secp256k1_ecdsa_recoverable_signature_serialize_compact ( _cx : * const Context , _output64 : * mut c_uchar ,
8686 _recid : * mut c_int , _sig : * const RecoverableSignature )
8787 -> c_int {
8888 unimplemented ! ( ) ;
Original file line number Diff line number Diff line change @@ -23,4 +23,19 @@ impl fmt::Debug for c_void {
2323 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2424 f. pad ( "c_void" )
2525 }
26+ }
27+
28+ #[ cfg( test) ]
29+ mod tests {
30+ use std:: os:: raw;
31+ use std:: any:: TypeId ;
32+ use types;
33+
34+ #[ test]
35+ fn verify_types ( ) {
36+ assert_eq ! ( TypeId :: of:: <types:: c_int>( ) , TypeId :: of:: <raw:: c_int>( ) ) ;
37+ assert_eq ! ( TypeId :: of:: <types:: c_uchar>( ) , TypeId :: of:: <raw:: c_uchar>( ) ) ;
38+ assert_eq ! ( TypeId :: of:: <types:: c_uint>( ) , TypeId :: of:: <raw:: c_uint>( ) ) ;
39+ assert_eq ! ( TypeId :: of:: <types:: c_char>( ) , TypeId :: of:: <raw:: c_char>( ) ) ;
40+ }
2641}
You can’t perform that action at this time.
0 commit comments