File tree 3 files changed +6
-18
lines changed
3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,8 @@ int main(void) {
30
30
secp256k1_pubkey pubkey1 ;
31
31
secp256k1_pubkey pubkey2 ;
32
32
33
- /* The specification in secp256k1.h states that `secp256k1_ec_pubkey_create`
34
- * needs a context object initialized for signing, which is why we create
35
- * a context with the SECP256K1_CONTEXT_SIGN flag.
36
- * (The docs for `secp256k1_ecdh` don't require any special context, just
37
- * some initialized context) */
38
- secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_SIGN );
33
+ /* Before we can call actual API functions, we need to create a "context". */
34
+ secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_NONE );
39
35
if (!fill_random (randomize , sizeof (randomize ))) {
40
36
printf ("Failed to generate randomness\n" );
41
37
return 1 ;
Original file line number Diff line number Diff line change @@ -38,12 +38,8 @@ int main(void) {
38
38
int return_val ;
39
39
secp256k1_pubkey pubkey ;
40
40
secp256k1_ecdsa_signature sig ;
41
- /* The specification in secp256k1.h states that `secp256k1_ec_pubkey_create` needs
42
- * a context object initialized for signing and `secp256k1_ecdsa_verify` needs
43
- * a context initialized for verification, which is why we create a context
44
- * for both signing and verification with the SECP256K1_CONTEXT_SIGN and
45
- * SECP256K1_CONTEXT_VERIFY flags. */
46
- secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY );
41
+ /* Before we can call actual API functions, we need to create a "context". */
42
+ secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_NONE );
47
43
if (!fill_random (randomize , sizeof (randomize ))) {
48
44
printf ("Failed to generate randomness\n" );
49
45
return 1 ;
Original file line number Diff line number Diff line change @@ -30,12 +30,8 @@ int main(void) {
30
30
int return_val ;
31
31
secp256k1_xonly_pubkey pubkey ;
32
32
secp256k1_keypair keypair ;
33
- /* The specification in secp256k1_extrakeys.h states that `secp256k1_keypair_create`
34
- * needs a context object initialized for signing. And in secp256k1_schnorrsig.h
35
- * they state that `secp256k1_schnorrsig_verify` needs a context initialized for
36
- * verification, which is why we create a context for both signing and verification
37
- * with the SECP256K1_CONTEXT_SIGN and SECP256K1_CONTEXT_VERIFY flags. */
38
- secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY );
33
+ /* Before we can call actual API functions, we need to create a "context". */
34
+ secp256k1_context * ctx = secp256k1_context_create (SECP256K1_CONTEXT_NONE );
39
35
if (!fill_random (randomize , sizeof (randomize ))) {
40
36
printf ("Failed to generate randomness\n" );
41
37
return 1 ;
You can’t perform that action at this time.
0 commit comments