Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

ecmult.h File Reference
#include "num.h"
#include "group.h"
#include "scalar.h"
#include "scratch.h"
+ Include dependency graph for ecmult.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  secp256k1_ecmult_context
 

Typedefs

typedef int() secp256k1_ecmult_multi_callback(secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data)
 

Functions

static void secp256k1_ecmult_context_init (secp256k1_ecmult_context *ctx)
 
static void secp256k1_ecmult_context_build (secp256k1_ecmult_context *ctx, const secp256k1_callback *cb)
 
static void secp256k1_ecmult_context_clone (secp256k1_ecmult_context *dst, const secp256k1_ecmult_context *src, const secp256k1_callback *cb)
 
static void secp256k1_ecmult_context_clear (secp256k1_ecmult_context *ctx)
 
static int secp256k1_ecmult_context_is_built (const secp256k1_ecmult_context *ctx)
 
static void secp256k1_ecmult (const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng)
 Double multiply: R = na*A + ng*G. More...
 
static int secp256k1_ecmult_multi_var (const secp256k1_ecmult_context *ctx, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n)
 Multi-multiply: R = inp_g_sc * G + sum_i ni * Ai. More...
 

Typedef Documentation

◆ secp256k1_ecmult_multi_callback

typedef int() secp256k1_ecmult_multi_callback(secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data)

Definition at line 33 of file ecmult.h.

Function Documentation

◆ secp256k1_ecmult()

◆ secp256k1_ecmult_context_build()

static void secp256k1_ecmult_context_build ( secp256k1_ecmult_context ctx,
const secp256k1_callback cb 
)
static

◆ secp256k1_ecmult_context_clear()

static void secp256k1_ecmult_context_clear ( secp256k1_ecmult_context ctx)
static

◆ secp256k1_ecmult_context_clone()

static void secp256k1_ecmult_context_clone ( secp256k1_ecmult_context dst,
const secp256k1_ecmult_context src,
const secp256k1_callback cb 
)
static

Referenced by secp256k1_context_clone().

◆ secp256k1_ecmult_context_init()

static void secp256k1_ecmult_context_init ( secp256k1_ecmult_context ctx)
static

◆ secp256k1_ecmult_context_is_built()

static int secp256k1_ecmult_context_is_built ( const secp256k1_ecmult_context ctx)
static

◆ secp256k1_ecmult_multi_var()

static int secp256k1_ecmult_multi_var ( const secp256k1_ecmult_context ctx,
secp256k1_scratch scratch,
secp256k1_gej r,
const secp256k1_scalar inp_g_sc,
secp256k1_ecmult_multi_callback  cb,
void *  cbdata,
size_t  n 
)
static

Multi-multiply: R = inp_g_sc * G + sum_i ni * Ai.

Chooses the right algorithm for a given number of points and scratch space size. Resets and overwrites the given scratch space. If the points do not fit in the scratch space the algorithm is repeatedly run with batches of points. If no scratch space is given then a simple algorithm is used that simply multiplies the points with the corresponding scalars and adds them up. Returns: 1 on success (including when inp_g_sc is NULL and n is 0) 0 if there is not enough scratch space for a single point or callback returns 0

Referenced by main(), run_ecmult_multi_tests(), test_ecmult_multi_batching(), and test_exhaustive_ecmult_multi().

Released under the MIT license