@@ -27,19 +27,19 @@ int main(void) {
2727 unsigned char randomize [32 ];
2828 int return_val ;
2929 size_t len ;
30- rustsecp256k1_v0_8_0_pubkey pubkey1 ;
31- rustsecp256k1_v0_8_0_pubkey pubkey2 ;
30+ rustsecp256k1_v0_8_1_pubkey pubkey1 ;
31+ rustsecp256k1_v0_8_1_pubkey pubkey2 ;
3232
3333 /* Before we can call actual API functions, we need to create a "context". */
34- rustsecp256k1_v0_8_0_context * ctx = rustsecp256k1_v0_8_0_context_create (SECP256K1_CONTEXT_NONE );
34+ rustsecp256k1_v0_8_1_context * ctx = rustsecp256k1_v0_8_1_context_create (SECP256K1_CONTEXT_NONE );
3535 if (!fill_random (randomize , sizeof (randomize ))) {
3636 printf ("Failed to generate randomness\n" );
3737 return 1 ;
3838 }
3939 /* Randomizing the context is recommended to protect against side-channel
40- * leakage See `rustsecp256k1_v0_8_0_context_randomize ` in secp256k1.h for more
40+ * leakage See `rustsecp256k1_v0_8_1_context_randomize ` in secp256k1.h for more
4141 * information about it. This should never fail. */
42- return_val = rustsecp256k1_v0_8_0_context_randomize (ctx , randomize );
42+ return_val = rustsecp256k1_v0_8_1_context_randomize (ctx , randomize );
4343 assert (return_val );
4444
4545 /*** Key Generation ***/
@@ -52,27 +52,27 @@ int main(void) {
5252 printf ("Failed to generate randomness\n" );
5353 return 1 ;
5454 }
55- if (rustsecp256k1_v0_8_0_ec_seckey_verify (ctx , seckey1 ) && rustsecp256k1_v0_8_0_ec_seckey_verify (ctx , seckey2 )) {
55+ if (rustsecp256k1_v0_8_1_ec_seckey_verify (ctx , seckey1 ) && rustsecp256k1_v0_8_1_ec_seckey_verify (ctx , seckey2 )) {
5656 break ;
5757 }
5858 }
5959
6060 /* Public key creation using a valid context with a verified secret key should never fail */
61- return_val = rustsecp256k1_v0_8_0_ec_pubkey_create (ctx , & pubkey1 , seckey1 );
61+ return_val = rustsecp256k1_v0_8_1_ec_pubkey_create (ctx , & pubkey1 , seckey1 );
6262 assert (return_val );
63- return_val = rustsecp256k1_v0_8_0_ec_pubkey_create (ctx , & pubkey2 , seckey2 );
63+ return_val = rustsecp256k1_v0_8_1_ec_pubkey_create (ctx , & pubkey2 , seckey2 );
6464 assert (return_val );
6565
6666 /* Serialize pubkey1 in a compressed form (33 bytes), should always return 1 */
6767 len = sizeof (compressed_pubkey1 );
68- return_val = rustsecp256k1_v0_8_0_ec_pubkey_serialize (ctx , compressed_pubkey1 , & len , & pubkey1 , SECP256K1_EC_COMPRESSED );
68+ return_val = rustsecp256k1_v0_8_1_ec_pubkey_serialize (ctx , compressed_pubkey1 , & len , & pubkey1 , SECP256K1_EC_COMPRESSED );
6969 assert (return_val );
7070 /* Should be the same size as the size of the output, because we passed a 33 byte array. */
7171 assert (len == sizeof (compressed_pubkey1 ));
7272
7373 /* Serialize pubkey2 in a compressed form (33 bytes) */
7474 len = sizeof (compressed_pubkey2 );
75- return_val = rustsecp256k1_v0_8_0_ec_pubkey_serialize (ctx , compressed_pubkey2 , & len , & pubkey2 , SECP256K1_EC_COMPRESSED );
75+ return_val = rustsecp256k1_v0_8_1_ec_pubkey_serialize (ctx , compressed_pubkey2 , & len , & pubkey2 , SECP256K1_EC_COMPRESSED );
7676 assert (return_val );
7777 /* Should be the same size as the size of the output, because we passed a 33 byte array. */
7878 assert (len == sizeof (compressed_pubkey2 ));
@@ -81,12 +81,12 @@ int main(void) {
8181
8282 /* Perform ECDH with seckey1 and pubkey2. Should never fail with a verified
8383 * seckey and valid pubkey */
84- return_val = rustsecp256k1_v0_8_0_ecdh (ctx , shared_secret1 , & pubkey2 , seckey1 , NULL , NULL );
84+ return_val = rustsecp256k1_v0_8_1_ecdh (ctx , shared_secret1 , & pubkey2 , seckey1 , NULL , NULL );
8585 assert (return_val );
8686
8787 /* Perform ECDH with seckey2 and pubkey1. Should never fail with a verified
8888 * seckey and valid pubkey */
89- return_val = rustsecp256k1_v0_8_0_ecdh (ctx , shared_secret2 , & pubkey1 , seckey2 , NULL , NULL );
89+ return_val = rustsecp256k1_v0_8_1_ecdh (ctx , shared_secret2 , & pubkey1 , seckey2 , NULL , NULL );
9090 assert (return_val );
9191
9292 /* Both parties should end up with the same shared secret */
@@ -105,7 +105,7 @@ int main(void) {
105105 print_hex (shared_secret1 , sizeof (shared_secret1 ));
106106
107107 /* This will clear everything from the context and free the memory */
108- rustsecp256k1_v0_8_0_context_destroy (ctx );
108+ rustsecp256k1_v0_8_1_context_destroy (ctx );
109109
110110 /* It's best practice to try to clear secrets from memory after using them.
111111 * This is done because some bugs can allow an attacker to leak memory, for
0 commit comments