9
9
10
10
#include "lax_der_privatekey_parsing.h"
11
11
12
- int ec_privkey_import_der (const rustsecp256k1zkp_v0_4_0_context * ctx , unsigned char * out32 , const unsigned char * privkey , size_t privkeylen ) {
12
+ int ec_privkey_import_der (const rustsecp256k1zkp_v0_5_0_context * ctx , unsigned char * out32 , const unsigned char * privkey , size_t privkeylen ) {
13
13
const unsigned char * end = privkey + privkeylen ;
14
14
int lenb = 0 ;
15
15
int len = 0 ;
@@ -46,17 +46,17 @@ int ec_privkey_import_der(const rustsecp256k1zkp_v0_4_0_context* ctx, unsigned c
46
46
return 0 ;
47
47
}
48
48
memcpy (out32 + 32 - privkey [1 ], privkey + 2 , privkey [1 ]);
49
- if (!rustsecp256k1zkp_v0_4_0_ec_seckey_verify (ctx , out32 )) {
49
+ if (!rustsecp256k1zkp_v0_5_0_ec_seckey_verify (ctx , out32 )) {
50
50
memset (out32 , 0 , 32 );
51
51
return 0 ;
52
52
}
53
53
return 1 ;
54
54
}
55
55
56
- int ec_privkey_export_der (const rustsecp256k1zkp_v0_4_0_context * ctx , unsigned char * privkey , size_t * privkeylen , const unsigned char * key32 , int compressed ) {
57
- rustsecp256k1zkp_v0_4_0_pubkey pubkey ;
56
+ int ec_privkey_export_der (const rustsecp256k1zkp_v0_5_0_context * ctx , unsigned char * privkey , size_t * privkeylen , const unsigned char * key32 , int compressed ) {
57
+ rustsecp256k1zkp_v0_5_0_pubkey pubkey ;
58
58
size_t pubkeylen = 0 ;
59
- if (!rustsecp256k1zkp_v0_4_0_ec_pubkey_create (ctx , & pubkey , key32 )) {
59
+ if (!rustsecp256k1zkp_v0_5_0_ec_pubkey_create (ctx , & pubkey , key32 )) {
60
60
* privkeylen = 0 ;
61
61
return 0 ;
62
62
}
@@ -80,7 +80,7 @@ int ec_privkey_export_der(const rustsecp256k1zkp_v0_4_0_context *ctx, unsigned c
80
80
memcpy (ptr , key32 , 32 ); ptr += 32 ;
81
81
memcpy (ptr , middle , sizeof (middle )); ptr += sizeof (middle );
82
82
pubkeylen = 33 ;
83
- rustsecp256k1zkp_v0_4_0_ec_pubkey_serialize (ctx , ptr , & pubkeylen , & pubkey , SECP256K1_EC_COMPRESSED );
83
+ rustsecp256k1zkp_v0_5_0_ec_pubkey_serialize (ctx , ptr , & pubkeylen , & pubkey , SECP256K1_EC_COMPRESSED );
84
84
ptr += pubkeylen ;
85
85
* privkeylen = ptr - privkey ;
86
86
} else {
@@ -105,7 +105,7 @@ int ec_privkey_export_der(const rustsecp256k1zkp_v0_4_0_context *ctx, unsigned c
105
105
memcpy (ptr , key32 , 32 ); ptr += 32 ;
106
106
memcpy (ptr , middle , sizeof (middle )); ptr += sizeof (middle );
107
107
pubkeylen = 65 ;
108
- rustsecp256k1zkp_v0_4_0_ec_pubkey_serialize (ctx , ptr , & pubkeylen , & pubkey , SECP256K1_EC_UNCOMPRESSED );
108
+ rustsecp256k1zkp_v0_5_0_ec_pubkey_serialize (ctx , ptr , & pubkeylen , & pubkey , SECP256K1_EC_UNCOMPRESSED );
109
109
ptr += pubkeylen ;
110
110
* privkeylen = ptr - privkey ;
111
111
}
0 commit comments