File tree 2 files changed +13
-12
lines changed
2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -58,36 +58,37 @@ pub const SECP256K1_SER_COMPRESSED: c_uint = (1 << 1) | (1 << 8);
58
58
/// around the FFI functions to use it. And it's an unsafe type.
59
59
/// Nonces are generated deterministically by RFC6979 by
60
60
/// default; there should be no need to ever change this.
61
- pub type NonceFn = unsafe extern "C" fn ( nonce32 : * mut c_uchar ,
62
- msg32 : * const c_uchar ,
63
- key32 : * const c_uchar ,
64
- algo16 : * const c_uchar ,
65
- data : * mut c_void ,
66
- attempt : c_uint ,
67
- ) -> c_int ;
61
+ pub type NonceFn = Option < unsafe extern "C" fn (
62
+ nonce32 : * mut c_uchar ,
63
+ msg32 : * const c_uchar ,
64
+ key32 : * const c_uchar ,
65
+ algo16 : * const c_uchar ,
66
+ data : * mut c_void ,
67
+ attempt : c_uint ,
68
+ ) -> c_int > ;
68
69
69
70
/// Hash function to use to post-process an ECDH point to get
70
71
/// a shared secret.
71
- pub type EcdhHashFn = unsafe extern "C" fn (
72
+ pub type EcdhHashFn = Option < unsafe extern "C" fn (
72
73
output : * mut c_uchar ,
73
74
x : * const c_uchar ,
74
75
y : * const c_uchar ,
75
76
data : * mut c_void ,
76
- ) -> c_int ;
77
+ ) -> c_int > ;
77
78
78
79
/// Same as secp256k1_nonce function with the exception of accepting an
79
80
/// additional pubkey argument and not requiring an attempt argument. The pubkey
80
81
/// argument can protect signature schemes with key-prefixed challenge hash
81
82
/// inputs against reusing the nonce when signing with the wrong precomputed
82
83
/// pubkey.
83
- pub type SchnorrNonceFn = unsafe extern "C" fn (
84
+ pub type SchnorrNonceFn = Option < unsafe extern "C" fn (
84
85
nonce32 : * mut c_uchar ,
85
86
msg32 : * const c_uchar ,
86
87
key32 : * const c_uchar ,
87
88
xonly_pk32 : * const c_uchar ,
88
89
algo16 : * const c_uchar ,
89
90
data : * mut c_void ,
90
- ) -> c_int ;
91
+ ) -> c_int > ;
91
92
92
93
/// A Secp256k1 context, containing various precomputed values and such
93
94
/// needed to do elliptic curve computations. If you create one of these
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ impl SharedSecret {
151
151
xy. as_mut_ptr ( ) ,
152
152
point. as_ptr ( ) ,
153
153
scalar. as_ptr ( ) ,
154
- c_callback,
154
+ Some ( c_callback) ,
155
155
ptr:: null_mut ( ) ,
156
156
)
157
157
} ;
You can’t perform that action at this time.
0 commit comments