aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/examples
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2022-12-12 23:40:36 -0500
committerPieter Wuille <pieter@wuille.net>2022-12-12 23:40:36 -0500
commit3d8a6ae28326ed10b6ca1c2807ceb400575f2ba7 (patch)
tree07232a7ba19ca0b911d7c3ce4187ee51e8515dec /src/secp256k1/examples
parent6061eb6564105ad54703a7cf3282590d0e1a7f28 (diff)
parent9d47e7b71b2805430e8c7b43816efd225a6ccd8c (diff)
downloadbitcoin-3d8a6ae28326ed10b6ca1c2807ceb400575f2ba7.tar.xz
Update secp256k1 subtree to upstream libsecp256k1 version 0.2.0
Diffstat (limited to 'src/secp256k1/examples')
-rw-r--r--src/secp256k1/examples/ecdh.c8
-rw-r--r--src/secp256k1/examples/ecdsa.c8
-rw-r--r--src/secp256k1/examples/schnorr.c8
3 files changed, 6 insertions, 18 deletions
diff --git a/src/secp256k1/examples/ecdh.c b/src/secp256k1/examples/ecdh.c
index d7e8add361..027d52fd5f 100644
--- a/src/secp256k1/examples/ecdh.c
+++ b/src/secp256k1/examples/ecdh.c
@@ -30,12 +30,8 @@ int main(void) {
secp256k1_pubkey pubkey1;
secp256k1_pubkey pubkey2;
- /* The specification in secp256k1.h states that `secp256k1_ec_pubkey_create`
- * needs a context object initialized for signing, which is why we create
- * a context with the SECP256K1_CONTEXT_SIGN flag.
- * (The docs for `secp256k1_ecdh` don't require any special context, just
- * some initialized context) */
- secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
+ /* Before we can call actual API functions, we need to create a "context". */
+ secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
if (!fill_random(randomize, sizeof(randomize))) {
printf("Failed to generate randomness\n");
return 1;
diff --git a/src/secp256k1/examples/ecdsa.c b/src/secp256k1/examples/ecdsa.c
index 434c856ba0..7e4f1b13ac 100644
--- a/src/secp256k1/examples/ecdsa.c
+++ b/src/secp256k1/examples/ecdsa.c
@@ -38,12 +38,8 @@ int main(void) {
int return_val;
secp256k1_pubkey pubkey;
secp256k1_ecdsa_signature sig;
- /* The specification in secp256k1.h states that `secp256k1_ec_pubkey_create` needs
- * a context object initialized for signing and `secp256k1_ecdsa_verify` needs
- * a context initialized for verification, which is why we create a context
- * for both signing and verification with the SECP256K1_CONTEXT_SIGN and
- * SECP256K1_CONTEXT_VERIFY flags. */
- secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
+ /* Before we can call actual API functions, we need to create a "context". */
+ secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
if (!fill_random(randomize, sizeof(randomize))) {
printf("Failed to generate randomness\n");
return 1;
diff --git a/src/secp256k1/examples/schnorr.c b/src/secp256k1/examples/schnorr.c
index 82eb07d5d7..207c45c422 100644
--- a/src/secp256k1/examples/schnorr.c
+++ b/src/secp256k1/examples/schnorr.c
@@ -30,12 +30,8 @@ int main(void) {
int return_val;
secp256k1_xonly_pubkey pubkey;
secp256k1_keypair keypair;
- /* The specification in secp256k1_extrakeys.h states that `secp256k1_keypair_create`
- * needs a context object initialized for signing. And in secp256k1_schnorrsig.h
- * they state that `secp256k1_schnorrsig_verify` needs a context initialized for
- * verification, which is why we create a context for both signing and verification
- * with the SECP256K1_CONTEXT_SIGN and SECP256K1_CONTEXT_VERIFY flags. */
- secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
+ /* Before we can call actual API functions, we need to create a "context". */
+ secp256k1_context* ctx = secp256k1_context_create(SECP256K1_CONTEXT_NONE);
if (!fill_random(randomize, sizeof(randomize))) {
printf("Failed to generate randomness\n");
return 1;