Skip to content

Commit a0f4644

Browse files
Merge #1252: Make position of * in pointer declarations in include/ consistent
3d1f430 Make position of * in pointer declarations in include/ consistent (Jonas Nick) Pull request description: ACKs for top commit: sipa: utACK 3d1f430. I have not verified these are the only instances where changes would need to be made. apoelstra: utACK 3d1f430 from me too. I also value consistency more than either specific choice.' real-or-random: utACK 3d1f430 Tree-SHA512: 6361880f4a47e58c83623f094dd121882752fa805e275033cd638d1e8d3477ade9037e5d9e34a57ae46013848648bd7ab764cad326133f2d3435c9a70a0c841b
2 parents 4e68262 + 3d1f430 commit a0f4644

6 files changed

+86
-86
lines changed

include/secp256k1.h

+49-49
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ SECP256K1_API void secp256k1_selftest(void);
288288
* Do not create a new context object for each operation, as construction and
289289
* randomization can take non-negligible time.
290290
*/
291-
SECP256K1_API secp256k1_context* secp256k1_context_create(
291+
SECP256K1_API secp256k1_context *secp256k1_context_create(
292292
unsigned int flags
293293
) SECP256K1_WARN_UNUSED_RESULT;
294294

@@ -304,8 +304,8 @@ SECP256K1_API secp256k1_context* secp256k1_context_create(
304304
* Returns: a newly created context object.
305305
* Args: ctx: an existing context to copy (not secp256k1_context_static)
306306
*/
307-
SECP256K1_API secp256k1_context* secp256k1_context_clone(
308-
const secp256k1_context* ctx
307+
SECP256K1_API secp256k1_context *secp256k1_context_clone(
308+
const secp256k1_context *ctx
309309
) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT;
310310

311311
/** Destroy a secp256k1 context object (created in dynamically allocated memory).
@@ -323,7 +323,7 @@ SECP256K1_API secp256k1_context* secp256k1_context_clone(
323323
* (i.e., not secp256k1_context_static).
324324
*/
325325
SECP256K1_API void secp256k1_context_destroy(
326-
secp256k1_context* ctx
326+
secp256k1_context *ctx
327327
) SECP256K1_ARG_NONNULL(1);
328328

329329
/** Set a callback function to be called when an illegal argument is passed to
@@ -347,8 +347,8 @@ SECP256K1_API void secp256k1_context_destroy(
347347
* USE_EXTERNAL_DEFAULT_CALLBACKS is defined, which is the case if the build
348348
* has been configured with --enable-external-default-callbacks. Then the
349349
* following two symbols must be provided to link against:
350-
* - void secp256k1_default_illegal_callback_fn(const char* message, void* data);
351-
* - void secp256k1_default_error_callback_fn(const char* message, void* data);
350+
* - void secp256k1_default_illegal_callback_fn(const char *message, void *data);
351+
* - void secp256k1_default_error_callback_fn(const char *message, void *data);
352352
* The library can call these default handlers even before a proper callback data
353353
* pointer could have been set using secp256k1_context_set_illegal_callback or
354354
* secp256k1_context_set_error_callback, e.g., when the creation of a context
@@ -364,9 +364,9 @@ SECP256K1_API void secp256k1_context_destroy(
364364
* See also secp256k1_context_set_error_callback.
365365
*/
366366
SECP256K1_API void secp256k1_context_set_illegal_callback(
367-
secp256k1_context* ctx,
368-
void (*fun)(const char* message, void* data),
369-
const void* data
367+
secp256k1_context *ctx,
368+
void (*fun)(const char *message, void *data),
369+
const void *data
370370
) SECP256K1_ARG_NONNULL(1);
371371

372372
/** Set a callback function to be called when an internal consistency check
@@ -392,9 +392,9 @@ SECP256K1_API void secp256k1_context_set_illegal_callback(
392392
* See also secp256k1_context_set_illegal_callback.
393393
*/
394394
SECP256K1_API void secp256k1_context_set_error_callback(
395-
secp256k1_context* ctx,
396-
void (*fun)(const char* message, void* data),
397-
const void* data
395+
secp256k1_context *ctx,
396+
void (*fun)(const char *message, void *data),
397+
const void *data
398398
) SECP256K1_ARG_NONNULL(1);
399399

400400
/** Create a secp256k1 scratch space object.
@@ -404,8 +404,8 @@ SECP256K1_API void secp256k1_context_set_error_callback(
404404
* In: size: amount of memory to be available as scratch space. Some extra
405405
* (<100 bytes) will be allocated for extra accounting.
406406
*/
407-
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space* secp256k1_scratch_space_create(
408-
const secp256k1_context* ctx,
407+
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space *secp256k1_scratch_space_create(
408+
const secp256k1_context *ctx,
409409
size_t size
410410
) SECP256K1_ARG_NONNULL(1);
411411

@@ -416,8 +416,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space* secp256k1_sc
416416
* scratch: space to destroy
417417
*/
418418
SECP256K1_API void secp256k1_scratch_space_destroy(
419-
const secp256k1_context* ctx,
420-
secp256k1_scratch_space* scratch
419+
const secp256k1_context *ctx,
420+
secp256k1_scratch_space *scratch
421421
) SECP256K1_ARG_NONNULL(1);
422422

423423
/** Parse a variable-length public key into the pubkey object.
@@ -435,8 +435,8 @@ SECP256K1_API void secp256k1_scratch_space_destroy(
435435
* byte 0x06 or 0x07) format public keys.
436436
*/
437437
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(
438-
const secp256k1_context* ctx,
439-
secp256k1_pubkey* pubkey,
438+
const secp256k1_context *ctx,
439+
secp256k1_pubkey *pubkey,
440440
const unsigned char *input,
441441
size_t inputlen
442442
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -457,10 +457,10 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(
457457
* compressed format, otherwise SECP256K1_EC_UNCOMPRESSED.
458458
*/
459459
SECP256K1_API int secp256k1_ec_pubkey_serialize(
460-
const secp256k1_context* ctx,
460+
const secp256k1_context *ctx,
461461
unsigned char *output,
462462
size_t *outputlen,
463-
const secp256k1_pubkey* pubkey,
463+
const secp256k1_pubkey *pubkey,
464464
unsigned int flags
465465
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
466466

@@ -474,9 +474,9 @@ SECP256K1_API int secp256k1_ec_pubkey_serialize(
474474
* pubkey2: second public key to compare
475475
*/
476476
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_cmp(
477-
const secp256k1_context* ctx,
478-
const secp256k1_pubkey* pubkey1,
479-
const secp256k1_pubkey* pubkey2
477+
const secp256k1_context *ctx,
478+
const secp256k1_pubkey *pubkey1,
479+
const secp256k1_pubkey *pubkey2
480480
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
481481

482482
/** Parse an ECDSA signature in compact (64 bytes) format.
@@ -495,8 +495,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_cmp(
495495
* any message and public key.
496496
*/
497497
SECP256K1_API int secp256k1_ecdsa_signature_parse_compact(
498-
const secp256k1_context* ctx,
499-
secp256k1_ecdsa_signature* sig,
498+
const secp256k1_context *ctx,
499+
secp256k1_ecdsa_signature *sig,
500500
const unsigned char *input64
501501
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
502502

@@ -516,8 +516,8 @@ SECP256K1_API int secp256k1_ecdsa_signature_parse_compact(
516516
* guaranteed to fail for every message and public key.
517517
*/
518518
SECP256K1_API int secp256k1_ecdsa_signature_parse_der(
519-
const secp256k1_context* ctx,
520-
secp256k1_ecdsa_signature* sig,
519+
const secp256k1_context *ctx,
520+
secp256k1_ecdsa_signature *sig,
521521
const unsigned char *input,
522522
size_t inputlen
523523
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -534,10 +534,10 @@ SECP256K1_API int secp256k1_ecdsa_signature_parse_der(
534534
* In: sig: a pointer to an initialized signature object
535535
*/
536536
SECP256K1_API int secp256k1_ecdsa_signature_serialize_der(
537-
const secp256k1_context* ctx,
537+
const secp256k1_context *ctx,
538538
unsigned char *output,
539539
size_t *outputlen,
540-
const secp256k1_ecdsa_signature* sig
540+
const secp256k1_ecdsa_signature *sig
541541
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
542542

543543
/** Serialize an ECDSA signature in compact (64 byte) format.
@@ -550,9 +550,9 @@ SECP256K1_API int secp256k1_ecdsa_signature_serialize_der(
550550
* See secp256k1_ecdsa_signature_parse_compact for details about the encoding.
551551
*/
552552
SECP256K1_API int secp256k1_ecdsa_signature_serialize_compact(
553-
const secp256k1_context* ctx,
553+
const secp256k1_context *ctx,
554554
unsigned char *output64,
555-
const secp256k1_ecdsa_signature* sig
555+
const secp256k1_ecdsa_signature *sig
556556
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
557557

558558
/** Verify an ECDSA signature.
@@ -581,7 +581,7 @@ SECP256K1_API int secp256k1_ecdsa_signature_serialize_compact(
581581
* For details, see the comments for that function.
582582
*/
583583
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(
584-
const secp256k1_context* ctx,
584+
const secp256k1_context *ctx,
585585
const secp256k1_ecdsa_signature *sig,
586586
const unsigned char *msghash32,
587587
const secp256k1_pubkey *pubkey
@@ -629,7 +629,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(
629629
* secp256k1_ecdsa_signature_normalize must be called before verification.
630630
*/
631631
SECP256K1_API int secp256k1_ecdsa_signature_normalize(
632-
const secp256k1_context* ctx,
632+
const secp256k1_context *ctx,
633633
secp256k1_ecdsa_signature *sigout,
634634
const secp256k1_ecdsa_signature *sigin
635635
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3);
@@ -662,7 +662,7 @@ SECP256K1_API_VAR const secp256k1_nonce_function secp256k1_nonce_function_defaul
662662
* secp256k1_ecdsa_signature_normalize for more details.
663663
*/
664664
SECP256K1_API int secp256k1_ecdsa_sign(
665-
const secp256k1_context* ctx,
665+
const secp256k1_context *ctx,
666666
secp256k1_ecdsa_signature *sig,
667667
const unsigned char *msghash32,
668668
const unsigned char *seckey,
@@ -683,7 +683,7 @@ SECP256K1_API int secp256k1_ecdsa_sign(
683683
* In: seckey: pointer to a 32-byte secret key.
684684
*/
685685
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(
686-
const secp256k1_context* ctx,
686+
const secp256k1_context *ctx,
687687
const unsigned char *seckey
688688
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);
689689

@@ -696,7 +696,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(
696696
* In: seckey: pointer to a 32-byte secret key.
697697
*/
698698
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(
699-
const secp256k1_context* ctx,
699+
const secp256k1_context *ctx,
700700
secp256k1_pubkey *pubkey,
701701
const unsigned char *seckey
702702
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -712,14 +712,14 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(
712712
* seckey will be set to some unspecified value.
713713
*/
714714
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_negate(
715-
const secp256k1_context* ctx,
715+
const secp256k1_context *ctx,
716716
unsigned char *seckey
717717
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);
718718

719719
/** Same as secp256k1_ec_seckey_negate, but DEPRECATED. Will be removed in
720720
* future versions. */
721721
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_negate(
722-
const secp256k1_context* ctx,
722+
const secp256k1_context *ctx,
723723
unsigned char *seckey
724724
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2)
725725
SECP256K1_DEPRECATED("Use secp256k1_ec_seckey_negate instead");
@@ -731,7 +731,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_negate(
731731
* In/Out: pubkey: pointer to the public key to be negated.
732732
*/
733733
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_negate(
734-
const secp256k1_context* ctx,
734+
const secp256k1_context *ctx,
735735
secp256k1_pubkey *pubkey
736736
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);
737737

@@ -751,15 +751,15 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_negate(
751751
* is negligible (around 1 in 2^128).
752752
*/
753753
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_tweak_add(
754-
const secp256k1_context* ctx,
754+
const secp256k1_context *ctx,
755755
unsigned char *seckey,
756756
const unsigned char *tweak32
757757
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
758758

759759
/** Same as secp256k1_ec_seckey_tweak_add, but DEPRECATED. Will be removed in
760760
* future versions. */
761761
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
762-
const secp256k1_context* ctx,
762+
const secp256k1_context *ctx,
763763
unsigned char *seckey,
764764
const unsigned char *tweak32
765765
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
@@ -779,7 +779,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
779779
* is negligible (around 1 in 2^128).
780780
*/
781781
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(
782-
const secp256k1_context* ctx,
782+
const secp256k1_context *ctx,
783783
secp256k1_pubkey *pubkey,
784784
const unsigned char *tweak32
785785
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -798,15 +798,15 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(
798798
* is negligible (around 1 in 2^128).
799799
*/
800800
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_tweak_mul(
801-
const secp256k1_context* ctx,
801+
const secp256k1_context *ctx,
802802
unsigned char *seckey,
803803
const unsigned char *tweak32
804804
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
805805

806806
/** Same as secp256k1_ec_seckey_tweak_mul, but DEPRECATED. Will be removed in
807807
* future versions. */
808808
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(
809-
const secp256k1_context* ctx,
809+
const secp256k1_context *ctx,
810810
unsigned char *seckey,
811811
const unsigned char *tweak32
812812
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
@@ -824,7 +824,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(
824824
* is negligible (around 1 in 2^128).
825825
*/
826826
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(
827-
const secp256k1_context* ctx,
827+
const secp256k1_context *ctx,
828828
secp256k1_pubkey *pubkey,
829829
const unsigned char *tweak32
830830
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
@@ -862,7 +862,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(
862862
* enhanced protection against side-channel leakage currently.
863863
*/
864864
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(
865-
secp256k1_context* ctx,
865+
secp256k1_context *ctx,
866866
const unsigned char *seed32
867867
) SECP256K1_ARG_NONNULL(1);
868868

@@ -876,9 +876,9 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(
876876
* n: the number of public keys to add together (must be at least 1).
877877
*/
878878
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(
879-
const secp256k1_context* ctx,
879+
const secp256k1_context *ctx,
880880
secp256k1_pubkey *out,
881-
const secp256k1_pubkey * const * ins,
881+
const secp256k1_pubkey * const *ins,
882882
size_t n
883883
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
884884

@@ -899,7 +899,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(
899899
* msglen: length of the message array
900900
*/
901901
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_tagged_sha256(
902-
const secp256k1_context* ctx,
902+
const secp256k1_context *ctx,
903903
unsigned char *hash32,
904904
const unsigned char *tag,
905905
size_t taglen,

include/secp256k1_ecdh.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ SECP256K1_API_VAR const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_functio
4848
* (can be NULL for secp256k1_ecdh_hash_function_sha256).
4949
*/
5050
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(
51-
const secp256k1_context* ctx,
51+
const secp256k1_context *ctx,
5252
unsigned char *output,
5353
const secp256k1_pubkey *pubkey,
5454
const unsigned char *seckey,

0 commit comments

Comments
 (0)