mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
tests: Add fuzzing harness for ec_seckey_import_der(...) and ec_seckey_export_der(...)
This commit is contained in:
@@ -31,7 +31,7 @@ static secp256k1_context* secp256k1_context_sign = nullptr;
|
||||
*
|
||||
* out32 must point to an output buffer of length at least 32 bytes.
|
||||
*/
|
||||
static int ec_seckey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *seckey, size_t seckeylen) {
|
||||
int ec_seckey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *seckey, size_t seckeylen) {
|
||||
const unsigned char *end = seckey + seckeylen;
|
||||
memset(out32, 0, 32);
|
||||
/* sequence header */
|
||||
@@ -88,7 +88,7 @@ static int ec_seckey_import_der(const secp256k1_context* ctx, unsigned char *out
|
||||
* will be set to the number of bytes used in the buffer.
|
||||
* key32 must point to a 32-byte raw private key.
|
||||
*/
|
||||
static int ec_seckey_export_der(const secp256k1_context *ctx, unsigned char *seckey, size_t *seckeylen, const unsigned char *key32, bool compressed) {
|
||||
int ec_seckey_export_der(const secp256k1_context *ctx, unsigned char *seckey, size_t *seckeylen, const unsigned char *key32, bool compressed) {
|
||||
assert(*seckeylen >= CKey::SIZE);
|
||||
secp256k1_pubkey pubkey;
|
||||
size_t pubkeylen = 0;
|
||||
|
||||
Reference in New Issue
Block a user