Bitcoin ABC 0.30.5
P2P Digital Currency
Functions
main_impl.h File Reference
#include "include/secp256k1_schnorr.h"
#include "modules/schnorr/schnorr_impl.h"
Include dependency graph for main_impl.h:

Go to the source code of this file.

Functions

int secp256k1_schnorr_verify (const secp256k1_context *ctx, const unsigned char *sig64, const unsigned char *msghash32, const secp256k1_pubkey *pubkey)
 Verify a signature created by secp256k1_schnorr_sign. More...
 
int secp256k1_schnorr_sign (const secp256k1_context *ctx, unsigned char *sig64, const unsigned char *msghash32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void *ndata)
 Create a signature using a custom EC-Schnorr-SHA256 construction. More...
 

Function Documentation

◆ secp256k1_schnorr_sign()

int secp256k1_schnorr_sign ( const secp256k1_context ctx,
unsigned char *  sig64,
const unsigned char *  msghash32,
const unsigned char *  seckey,
secp256k1_nonce_function  noncefp,
const void *  ndata 
)

Create a signature using a custom EC-Schnorr-SHA256 construction.

It produces non-malleable 64-byte signatures which support batch validation, and multiparty signing. 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: sig64: pointer to a 64-byte array where the signature will be placed (cannot be NULL) In: msghash32: 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 33 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_schnorr_verify()

int secp256k1_schnorr_verify ( const secp256k1_context ctx,
const unsigned char *  sig64,
const unsigned char *  msghash32,
const secp256k1_pubkey pubkey 
)

Verify a signature created by secp256k1_schnorr_sign.

Returns: 1: correct signature 0: incorrect signature Args: ctx: a secp256k1 context object, initialized for verification. In: sig64: the 64-byte signature being verified (cannot be NULL) msghash32: the 32-byte message hash being verified (cannot be NULL). The verifier must make sure to apply a cryptographic hash function to the message by itself and not accept an msghash32 value directly. Otherwise, it would be easy to create a "valid" signature without knowledge of the secret key. pubkey: the public key to verify with (cannot be NULL)

Definition at line 13 of file main_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function: