Skip to content

Commit dd891e0

Browse files
committed
Get rid of _t as it is POSIX reserved
1 parent 201819b commit dd891e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+943
-943
lines changed

include/secp256k1.h

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extern "C" {
4040
* Regarding randomization, either do it once at creation time (in which case
4141
* you do not need any locking for the other calls), or use a read-write lock.
4242
*/
43-
typedef struct secp256k1_context_struct secp256k1_context_t;
43+
typedef struct secp256k1_context_struct secp256k1_context;
4444

4545
/** Opaque data structure that holds a parsed and valid public key.
4646
*
@@ -55,7 +55,7 @@ typedef struct secp256k1_context_struct secp256k1_context_t;
5555
*/
5656
typedef struct {
5757
unsigned char data[64];
58-
} secp256k1_pubkey_t;
58+
} secp256k1_pubkey;
5959

6060
/** Opaque data structured that holds a parsed ECDSA signature.
6161
*
@@ -71,7 +71,7 @@ typedef struct {
7171
*/
7272
typedef struct {
7373
unsigned char data[64];
74-
} secp256k1_ecdsa_signature_t;
74+
} secp256k1_ecdsa_signature;
7575

7676
/** A pointer to a function to deterministically generate a nonce.
7777
*
@@ -89,7 +89,7 @@ typedef struct {
8989
* Except for test cases, this function should compute some cryptographic hash of
9090
* the message, the algorithm, the key and the attempt.
9191
*/
92-
typedef int (*secp256k1_nonce_function_t)(
92+
typedef int (*secp256k1_nonce_function)(
9393
unsigned char *nonce32,
9494
const unsigned char *msg32,
9595
const unsigned char *key32,
@@ -145,7 +145,7 @@ typedef int (*secp256k1_nonce_function_t)(
145145
* Returns: a newly created context object.
146146
* In: flags: which parts of the context to initialize.
147147
*/
148-
secp256k1_context_t* secp256k1_context_create(
148+
secp256k1_context* secp256k1_context_create(
149149
unsigned int flags
150150
) SECP256K1_WARN_UNUSED_RESULT;
151151

@@ -154,8 +154,8 @@ secp256k1_context_t* secp256k1_context_create(
154154
* Returns: a newly created context object.
155155
* Args: ctx: an existing context to copy (cannot be NULL)
156156
*/
157-
secp256k1_context_t* secp256k1_context_clone(
158-
const secp256k1_context_t* ctx
157+
secp256k1_context* secp256k1_context_clone(
158+
const secp256k1_context* ctx
159159
) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT;
160160

161161
/** Destroy a secp256k1 context object.
@@ -164,7 +164,7 @@ secp256k1_context_t* secp256k1_context_clone(
164164
* Args: ctx: an existing context to destroy (cannot be NULL)
165165
*/
166166
void secp256k1_context_destroy(
167-
secp256k1_context_t* ctx
167+
secp256k1_context* ctx
168168
);
169169

170170
/** Set a callback function to be called when an illegal argument is passed to
@@ -188,7 +188,7 @@ void secp256k1_context_destroy(
188188
* data: the opaque pointer to pass to fun above.
189189
*/
190190
void secp256k1_context_set_illegal_callback(
191-
secp256k1_context_t* ctx,
191+
secp256k1_context* ctx,
192192
void (*fun)(const char* message, void* data),
193193
const void* data
194194
) SECP256K1_ARG_NONNULL(1);
@@ -210,7 +210,7 @@ void secp256k1_context_set_illegal_callback(
210210
* data: the opaque pointer to pass to fun above.
211211
*/
212212
void secp256k1_context_set_error_callback(
213-
secp256k1_context_t* ctx,
213+
secp256k1_context* ctx,
214214
void (*fun)(const char* message, void* data),
215215
const void* data
216216
) SECP256K1_ARG_NONNULL(1);
@@ -230,8 +230,8 @@ void secp256k1_context_set_error_callback(
230230
* byte 0x06 or 0x07) format public keys.
231231
*/
232232
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(
233-
const secp256k1_context_t* ctx,
234-
secp256k1_pubkey_t* pubkey,
233+
const secp256k1_context* ctx,
234+
secp256k1_pubkey* pubkey,
235235
const unsigned char *input,
236236
size_t inputlen
237237
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -244,16 +244,16 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(
244244
* compressed==1) byte array to place the serialized key in.
245245
* outputlen: a pointer to an integer which will contain the serialized
246246
* size.
247-
* In: pubkey: a pointer to a secp256k1_pubkey_t containing an initialized
247+
* In: pubkey: a pointer to a secp256k1_pubkey containing an initialized
248248
* public key.
249249
* flags: SECP256K1_EC_COMPRESSED if serialization should be in
250250
* compressed format.
251251
*/
252252
int secp256k1_ec_pubkey_serialize(
253-
const secp256k1_context_t* ctx,
253+
const secp256k1_context* ctx,
254254
unsigned char *output,
255255
size_t *outputlen,
256-
const secp256k1_pubkey_t* pubkey,
256+
const secp256k1_pubkey* pubkey,
257257
unsigned int flags
258258
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
259259

@@ -268,8 +268,8 @@ int secp256k1_ec_pubkey_serialize(
268268
* Note that this function also supports some violations of DER and even BER.
269269
*/
270270
int secp256k1_ecdsa_signature_parse_der(
271-
const secp256k1_context_t* ctx,
272-
secp256k1_ecdsa_signature_t* sig,
271+
const secp256k1_context* ctx,
272+
secp256k1_ecdsa_signature* sig,
273273
const unsigned char *input,
274274
size_t inputlen
275275
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -286,10 +286,10 @@ int secp256k1_ecdsa_signature_parse_der(
286286
* In: sig: a pointer to an initialized signature object
287287
*/
288288
int secp256k1_ecdsa_signature_serialize_der(
289-
const secp256k1_context_t* ctx,
289+
const secp256k1_context* ctx,
290290
unsigned char *output,
291291
size_t *outputlen,
292-
const secp256k1_ecdsa_signature_t* sig
292+
const secp256k1_ecdsa_signature* sig
293293
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
294294

295295
/** Verify an ECDSA signature.
@@ -302,20 +302,20 @@ int secp256k1_ecdsa_signature_serialize_der(
302302
* pubkey: pointer to an initialized public key to verify with (cannot be NULL)
303303
*/
304304
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(
305-
const secp256k1_context_t* ctx,
306-
const secp256k1_ecdsa_signature_t *sig,
305+
const secp256k1_context* ctx,
306+
const secp256k1_ecdsa_signature *sig,
307307
const unsigned char *msg32,
308-
const secp256k1_pubkey_t *pubkey
308+
const secp256k1_pubkey *pubkey
309309
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
310310

311311
/** An implementation of RFC6979 (using HMAC-SHA256) as nonce generation function.
312312
* If a data pointer is passed, it is assumed to be a pointer to 32 bytes of
313313
* extra entropy.
314314
*/
315-
extern const secp256k1_nonce_function_t secp256k1_nonce_function_rfc6979;
315+
extern const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;
316316

317317
/** A default safe nonce generation function (currently equal to secp256k1_nonce_function_rfc6979). */
318-
extern const secp256k1_nonce_function_t secp256k1_nonce_function_default;
318+
extern const secp256k1_nonce_function secp256k1_nonce_function_default;
319319

320320
/** Create an ECDSA signature.
321321
*
@@ -356,11 +356,11 @@ extern const secp256k1_nonce_function_t secp256k1_nonce_function_default;
356356
* be taken when this property is required for an application.
357357
*/
358358
int secp256k1_ecdsa_sign(
359-
const secp256k1_context_t* ctx,
360-
secp256k1_ecdsa_signature_t *sig,
359+
const secp256k1_context* ctx,
360+
secp256k1_ecdsa_signature *sig,
361361
const unsigned char *msg32,
362362
const unsigned char *seckey,
363-
secp256k1_nonce_function_t noncefp,
363+
secp256k1_nonce_function noncefp,
364364
const void *ndata
365365
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
366366

@@ -372,7 +372,7 @@ int secp256k1_ecdsa_sign(
372372
* In: seckey: pointer to a 32-byte secret key (cannot be NULL)
373373
*/
374374
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(
375-
const secp256k1_context_t* ctx,
375+
const secp256k1_context* ctx,
376376
const unsigned char *seckey
377377
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);
378378

@@ -385,8 +385,8 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(
385385
* In: seckey: pointer to a 32-byte private key (cannot be NULL)
386386
*/
387387
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(
388-
const secp256k1_context_t* ctx,
389-
secp256k1_pubkey_t *pubkey,
388+
const secp256k1_context* ctx,
389+
secp256k1_pubkey *pubkey,
390390
const unsigned char *seckey
391391
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
392392

@@ -411,7 +411,7 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(
411411
* guaranteed to be parsable by secp256k1_ec_privkey_import.
412412
*/
413413
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_export(
414-
const secp256k1_context_t* ctx,
414+
const secp256k1_context* ctx,
415415
unsigned char *privkey,
416416
size_t *privkeylen,
417417
const unsigned char *seckey,
@@ -433,7 +433,7 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_export(
433433
* key.
434434
*/
435435
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_import(
436-
const secp256k1_context_t* ctx,
436+
const secp256k1_context* ctx,
437437
unsigned char *seckey,
438438
const unsigned char *privkey,
439439
size_t privkeylen
@@ -449,7 +449,7 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_import(
449449
* In: tweak: pointer to a 32-byte tweak.
450450
*/
451451
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
452-
const secp256k1_context_t* ctx,
452+
const secp256k1_context* ctx,
453453
unsigned char *seckey,
454454
const unsigned char *tweak
455455
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -465,8 +465,8 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
465465
* In: tweak: pointer to a 32-byte tweak.
466466
*/
467467
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(
468-
const secp256k1_context_t* ctx,
469-
secp256k1_pubkey_t *pubkey,
468+
const secp256k1_context* ctx,
469+
secp256k1_pubkey *pubkey,
470470
const unsigned char *tweak
471471
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
472472

@@ -478,7 +478,7 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(
478478
* In: tweak: pointer to a 32-byte tweak.
479479
*/
480480
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(
481-
const secp256k1_context_t* ctx,
481+
const secp256k1_context* ctx,
482482
unsigned char *seckey,
483483
const unsigned char *tweak
484484
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -492,8 +492,8 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(
492492
* In: tweak: pointer to a 32-byte tweak.
493493
*/
494494
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(
495-
const secp256k1_context_t* ctx,
496-
secp256k1_pubkey_t *pubkey,
495+
const secp256k1_context* ctx,
496+
secp256k1_pubkey *pubkey,
497497
const unsigned char *tweak
498498
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
499499

@@ -504,7 +504,7 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(
504504
* In: seed32: pointer to a 32-byte random seed (NULL resets to initial state)
505505
*/
506506
SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(
507-
secp256k1_context_t* ctx,
507+
secp256k1_context* ctx,
508508
const unsigned char *seed32
509509
) SECP256K1_ARG_NONNULL(1);
510510

@@ -520,9 +520,9 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(
520520
* uncompressed format is needed.
521521
*/
522522
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(
523-
const secp256k1_context_t* ctx,
524-
secp256k1_pubkey_t *out,
525-
const secp256k1_pubkey_t * const * ins,
523+
const secp256k1_context* ctx,
524+
secp256k1_pubkey *out,
525+
const secp256k1_pubkey * const * ins,
526526
int n
527527
) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
528528

include/secp256k1_ecdh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ extern "C" {
1717
* scalar: a 32-byte scalar with which to multiply the point
1818
*/
1919
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(
20-
const secp256k1_context_t* ctx,
20+
const secp256k1_context* ctx,
2121
unsigned char *result,
22-
const secp256k1_pubkey_t *point,
22+
const secp256k1_pubkey *point,
2323
const unsigned char *scalar
2424
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
2525

include/secp256k1_recovery.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
*/
2424
typedef struct {
2525
unsigned char data[65];
26-
} secp256k1_ecdsa_recoverable_signature_t;
26+
} secp256k1_ecdsa_recoverable_signature;
2727

2828
/** Parse a compact ECDSA signature (64 bytes + recovery id).
2929
*
@@ -34,8 +34,8 @@ typedef struct {
3434
* recid: the recovery id (0, 1, 2 or 3)
3535
*/
3636
int secp256k1_ecdsa_recoverable_signature_parse_compact(
37-
const secp256k1_context_t* ctx,
38-
secp256k1_ecdsa_recoverable_signature_t* sig,
37+
const secp256k1_context* ctx,
38+
secp256k1_ecdsa_recoverable_signature* sig,
3939
const unsigned char *input64,
4040
int recid
4141
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -47,9 +47,9 @@ int secp256k1_ecdsa_recoverable_signature_parse_compact(
4747
* In: sigin: a pointer to a recoverable signature (cannot be NULL).
4848
*/
4949
int secp256k1_ecdsa_recoverable_signature_convert(
50-
const secp256k1_context_t* ctx,
51-
secp256k1_ecdsa_signature_t* sig,
52-
const secp256k1_ecdsa_recoverable_signature_t* sigin
50+
const secp256k1_context* ctx,
51+
secp256k1_ecdsa_signature* sig,
52+
const secp256k1_ecdsa_recoverable_signature* sigin
5353
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
5454

5555
/** Serialize an ECDSA signature in compact format (64 bytes + recovery id).
@@ -61,10 +61,10 @@ int secp256k1_ecdsa_recoverable_signature_convert(
6161
* In: sig: a pointer to an initialized signature object (cannot be NULL)
6262
*/
6363
int secp256k1_ecdsa_recoverable_signature_serialize_compact(
64-
const secp256k1_context_t* ctx,
64+
const secp256k1_context* ctx,
6565
unsigned char *output64,
6666
int *recid,
67-
const secp256k1_ecdsa_recoverable_signature_t* sig
67+
const secp256k1_ecdsa_recoverable_signature* sig
6868
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4);
6969

7070
/** Create a recoverable ECDSA signature.
@@ -79,11 +79,11 @@ int secp256k1_ecdsa_recoverable_signature_serialize_compact(
7979
* ndata: pointer to arbitrary data used by the nonce generation function (can be NULL)
8080
*/
8181
int secp256k1_ecdsa_sign_recoverable(
82-
const secp256k1_context_t* ctx,
83-
secp256k1_ecdsa_recoverable_signature_t *sig,
82+
const secp256k1_context* ctx,
83+
secp256k1_ecdsa_recoverable_signature *sig,
8484
const unsigned char *msg32,
8585
const unsigned char *seckey,
86-
secp256k1_nonce_function_t noncefp,
86+
secp256k1_nonce_function noncefp,
8787
const void *ndata
8888
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
8989

@@ -97,9 +97,9 @@ int secp256k1_ecdsa_sign_recoverable(
9797
* msg32: the 32-byte message hash assumed to be signed (cannot be NULL)
9898
*/
9999
SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover(
100-
const secp256k1_context_t* ctx,
101-
secp256k1_pubkey_t *pubkey,
102-
const secp256k1_ecdsa_recoverable_signature_t *sig,
100+
const secp256k1_context* ctx,
101+
secp256k1_pubkey *pubkey,
102+
const secp256k1_ecdsa_recoverable_signature *sig,
103103
const unsigned char *msg32
104104
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
105105

0 commit comments

Comments
 (0)