Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include "include/secp256k1_recovery.h"
Go to the source code of this file.
Function Documentation
◆ secp256k1_ecdsa_recover()
int secp256k1_ecdsa_recover | ( | const secp256k1_context * | ctx, |
secp256k1_pubkey * | pubkey, | ||
const secp256k1_ecdsa_recoverable_signature * | sig, | ||
const unsigned char * | msg32 | ||
) |
Recover an ECDSA public key from a signature.
Returns: 1: public key successfully recovered (which guarantees a correct signature). 0: otherwise. Args: ctx: pointer to a context object, initialized for verification (cannot be NULL) Out: pubkey: pointer to the recovered public key (cannot be NULL) In: sig: pointer to initialized signature that supports pubkey recovery (cannot be NULL) msg32: the 32-byte message hash assumed to be signed (cannot be NULL)
Definition at line 170 of file main_impl.h.
References ARG_CHECK, ctx, secp256k1_context_struct::ecmult_ctx, secp256k1_ecdsa_recoverable_signature_load(), secp256k1_ecdsa_sig_recover(), secp256k1_ecmult_context_is_built(), secp256k1_pubkey_save(), secp256k1_scalar_set_b32(), and VERIFY_CHECK.
Referenced by bench_recover(), CPubKey::RecoverCompact(), test_ecdsa_recovery_api(), test_ecdsa_recovery_edge_cases(), and test_ecdsa_recovery_end_to_end().
◆ secp256k1_ecdsa_recoverable_signature_convert()
int secp256k1_ecdsa_recoverable_signature_convert | ( | const secp256k1_context * | ctx, |
secp256k1_ecdsa_signature * | sig, | ||
const secp256k1_ecdsa_recoverable_signature * | sigin | ||
) |
Convert a recoverable signature into a normal signature.
Returns: 1 Out: sig: a pointer to a normal signature (cannot be NULL). In: sigin: a pointer to a recoverable signature (cannot be NULL).
Definition at line 74 of file main_impl.h.
References ARG_CHECK, ctx, secp256k1_ecdsa_recoverable_signature_load(), and secp256k1_ecdsa_signature_save().
Referenced by test_ecdsa_recovery_api(), and test_ecdsa_recovery_end_to_end().
◆ secp256k1_ecdsa_recoverable_signature_load()
|
static |
Definition at line 12 of file main_impl.h.
References ctx, secp256k1_ecdsa_recoverable_signature::data, memcpy(), and secp256k1_scalar_set_b32().
Referenced by secp256k1_ecdsa_recover(), secp256k1_ecdsa_recoverable_signature_convert(), and secp256k1_ecdsa_recoverable_signature_serialize_compact().
◆ secp256k1_ecdsa_recoverable_signature_parse_compact()
int secp256k1_ecdsa_recoverable_signature_parse_compact | ( | const secp256k1_context * | ctx, |
secp256k1_ecdsa_recoverable_signature * | sig, | ||
const unsigned char * | input64, | ||
int | recid | ||
) |
Parse a compact ECDSA signature (64 bytes + recovery id).
Returns: 1 when the signature could be parsed, 0 otherwise Args: ctx: a secp256k1 context object Out: sig: a pointer to a signature object In: input64: a pointer to a 64-byte compact signature recid: the recovery id (0, 1, 2 or 3)
Definition at line 38 of file main_impl.h.
References ARG_CHECK, ctx, secp256k1_ecdsa_recoverable_signature_save(), and secp256k1_scalar_set_b32().
Referenced by bench_recover(), CPubKey::RecoverCompact(), test_ecdsa_recovery_api(), test_ecdsa_recovery_edge_cases(), and test_ecdsa_recovery_end_to_end().
◆ secp256k1_ecdsa_recoverable_signature_save()
|
static |
Definition at line 27 of file main_impl.h.
References secp256k1_ecdsa_recoverable_signature::data, memcpy(), and secp256k1_scalar_get_b32().
Referenced by secp256k1_ecdsa_recoverable_signature_parse_compact(), and secp256k1_ecdsa_sign_recoverable().
◆ secp256k1_ecdsa_recoverable_signature_serialize_compact()
int secp256k1_ecdsa_recoverable_signature_serialize_compact | ( | const secp256k1_context * | ctx, |
unsigned char * | output64, | ||
int * | recid, | ||
const secp256k1_ecdsa_recoverable_signature * | sig | ||
) |
Serialize an ECDSA signature in compact format (64 bytes + recovery id).
Returns: 1 Args: ctx: a secp256k1 context object Out: output64: a pointer to a 64-byte array of the compact signature (cannot be NULL) recid: a pointer to an integer to hold the recovery id (can be NULL). In: sig: a pointer to an initialized signature object (cannot be NULL)
Definition at line 60 of file main_impl.h.
References ARG_CHECK, ctx, secp256k1_ecdsa_recoverable_signature_load(), and secp256k1_scalar_get_b32().
Referenced by CKey::SignCompact(), test_ecdsa_recovery_api(), and test_ecdsa_recovery_end_to_end().
◆ secp256k1_ecdsa_sig_recover()
|
static |
Definition at line 87 of file main_impl.h.
References ctx, secp256k1_ecdsa_const_order_as_fe, secp256k1_ecdsa_const_p_minus_order, secp256k1_ecmult(), secp256k1_fe_add(), secp256k1_fe_cmp_var(), secp256k1_fe_set_b32(), secp256k1_ge_set_gej_var(), secp256k1_ge_set_xo_var(), secp256k1_gej_is_infinity(), secp256k1_gej_set_ge(), secp256k1_scalar_get_b32(), secp256k1_scalar_inverse_var(), secp256k1_scalar_is_zero(), secp256k1_scalar_mul(), secp256k1_scalar_negate(), and VERIFY_CHECK.
Referenced by secp256k1_ecdsa_recover().
◆ secp256k1_ecdsa_sign_recoverable()
int secp256k1_ecdsa_sign_recoverable | ( | const secp256k1_context * | ctx, |
secp256k1_ecdsa_recoverable_signature * | sig, | ||
const unsigned char * | msg32, | ||
const unsigned char * | seckey, | ||
secp256k1_nonce_function | noncefp, | ||
const void * | ndata | ||
) |
Create a recoverable ECDSA signature.
Returns: 1: signature created 0: the nonce generation function failed, or the private key was invalid. Args: ctx: pointer to a context object, initialized for signing (cannot be NULL) Out: sig: pointer to an array where the signature will be placed (cannot be NULL) In: msg32: the 32-byte message hash being signed (cannot be NULL) seckey: pointer to a 32-byte secret key (cannot be NULL) noncefp:pointer to a nonce generation function. If NULL, secp256k1_nonce_function_default is used ndata: pointer to arbitrary data used by the nonce generation function (can be NULL)
Definition at line 123 of file main_impl.h.
References ARG_CHECK, count, ctx, secp256k1_context_struct::ecmult_gen_ctx, secp256k1_ecdsa_recoverable_signature_save(), secp256k1_ecdsa_sig_sign(), secp256k1_ecmult_gen_context_is_built(), secp256k1_nonce_function_default, secp256k1_scalar_clear(), secp256k1_scalar_is_zero(), secp256k1_scalar_set_b32(), and VERIFY_CHECK.
Referenced by CKey::SignCompact(), test_ecdsa_recovery_api(), and test_ecdsa_recovery_end_to_end().