@@ -26,19 +26,19 @@ int main(void) {
2626 unsigned char randomize [32 ];
2727 int return_val ;
2828 size_t len ;
29- rustsecp256k1_v0_8_1_pubkey pubkey1 ;
30- rustsecp256k1_v0_8_1_pubkey pubkey2 ;
29+ rustsecp256k1_v0_9_0_pubkey pubkey1 ;
30+ rustsecp256k1_v0_9_0_pubkey pubkey2 ;
3131
3232 /* Before we can call actual API functions, we need to create a "context". */
33- rustsecp256k1_v0_8_1_context * ctx = rustsecp256k1_v0_8_1_context_create (SECP256K1_CONTEXT_NONE );
33+ rustsecp256k1_v0_9_0_context * ctx = rustsecp256k1_v0_9_0_context_create (SECP256K1_CONTEXT_NONE );
3434 if (!fill_random (randomize , sizeof (randomize ))) {
3535 printf ("Failed to generate randomness\n" );
3636 return 1 ;
3737 }
3838 /* Randomizing the context is recommended to protect against side-channel
39- * leakage See `rustsecp256k1_v0_8_1_context_randomize ` in secp256k1.h for more
39+ * leakage See `rustsecp256k1_v0_9_0_context_randomize ` in secp256k1.h for more
4040 * information about it. This should never fail. */
41- return_val = rustsecp256k1_v0_8_1_context_randomize (ctx , randomize );
41+ return_val = rustsecp256k1_v0_9_0_context_randomize (ctx , randomize );
4242 assert (return_val );
4343
4444 /*** Key Generation ***/
@@ -51,27 +51,27 @@ int main(void) {
5151 printf ("Failed to generate randomness\n" );
5252 return 1 ;
5353 }
54- if (rustsecp256k1_v0_8_1_ec_seckey_verify (ctx , seckey1 ) && rustsecp256k1_v0_8_1_ec_seckey_verify (ctx , seckey2 )) {
54+ if (rustsecp256k1_v0_9_0_ec_seckey_verify (ctx , seckey1 ) && rustsecp256k1_v0_9_0_ec_seckey_verify (ctx , seckey2 )) {
5555 break ;
5656 }
5757 }
5858
5959 /* Public key creation using a valid context with a verified secret key should never fail */
60- return_val = rustsecp256k1_v0_8_1_ec_pubkey_create (ctx , & pubkey1 , seckey1 );
60+ return_val = rustsecp256k1_v0_9_0_ec_pubkey_create (ctx , & pubkey1 , seckey1 );
6161 assert (return_val );
62- return_val = rustsecp256k1_v0_8_1_ec_pubkey_create (ctx , & pubkey2 , seckey2 );
62+ return_val = rustsecp256k1_v0_9_0_ec_pubkey_create (ctx , & pubkey2 , seckey2 );
6363 assert (return_val );
6464
6565 /* Serialize pubkey1 in a compressed form (33 bytes), should always return 1 */
6666 len = sizeof (compressed_pubkey1 );
67- return_val = rustsecp256k1_v0_8_1_ec_pubkey_serialize (ctx , compressed_pubkey1 , & len , & pubkey1 , SECP256K1_EC_COMPRESSED );
67+ return_val = rustsecp256k1_v0_9_0_ec_pubkey_serialize (ctx , compressed_pubkey1 , & len , & pubkey1 , SECP256K1_EC_COMPRESSED );
6868 assert (return_val );
6969 /* Should be the same size as the size of the output, because we passed a 33 byte array. */
7070 assert (len == sizeof (compressed_pubkey1 ));
7171
7272 /* Serialize pubkey2 in a compressed form (33 bytes) */
7373 len = sizeof (compressed_pubkey2 );
74- return_val = rustsecp256k1_v0_8_1_ec_pubkey_serialize (ctx , compressed_pubkey2 , & len , & pubkey2 , SECP256K1_EC_COMPRESSED );
74+ return_val = rustsecp256k1_v0_9_0_ec_pubkey_serialize (ctx , compressed_pubkey2 , & len , & pubkey2 , SECP256K1_EC_COMPRESSED );
7575 assert (return_val );
7676 /* Should be the same size as the size of the output, because we passed a 33 byte array. */
7777 assert (len == sizeof (compressed_pubkey2 ));
@@ -80,12 +80,12 @@ int main(void) {
8080
8181 /* Perform ECDH with seckey1 and pubkey2. Should never fail with a verified
8282 * seckey and valid pubkey */
83- return_val = rustsecp256k1_v0_8_1_ecdh (ctx , shared_secret1 , & pubkey2 , seckey1 , NULL , NULL );
83+ return_val = rustsecp256k1_v0_9_0_ecdh (ctx , shared_secret1 , & pubkey2 , seckey1 , NULL , NULL );
8484 assert (return_val );
8585
8686 /* Perform ECDH with seckey2 and pubkey1. Should never fail with a verified
8787 * seckey and valid pubkey */
88- return_val = rustsecp256k1_v0_8_1_ecdh (ctx , shared_secret2 , & pubkey1 , seckey2 , NULL , NULL );
88+ return_val = rustsecp256k1_v0_9_0_ecdh (ctx , shared_secret2 , & pubkey1 , seckey2 , NULL , NULL );
8989 assert (return_val );
9090
9191 /* Both parties should end up with the same shared secret */
@@ -104,7 +104,7 @@ int main(void) {
104104 print_hex (shared_secret1 , sizeof (shared_secret1 ));
105105
106106 /* This will clear everything from the context and free the memory */
107- rustsecp256k1_v0_8_1_context_destroy (ctx );
107+ rustsecp256k1_v0_9_0_context_destroy (ctx );
108108
109109 /* It's best practice to try to clear secrets from memory after using them.
110110 * This is done because some bugs can allow an attacker to leak memory, for
0 commit comments