[API BREAK] Introduce explicit contexts
This commit is contained in:
16
src/ecmult.h
16
src/ecmult.h
@@ -10,10 +10,20 @@
|
||||
#include "num.h"
|
||||
#include "group.h"
|
||||
|
||||
static void secp256k1_ecmult_start(void);
|
||||
static void secp256k1_ecmult_stop(void);
|
||||
typedef struct {
|
||||
/* For accelerating the computation of a*P + b*G: */
|
||||
secp256k1_ge_storage_t (*pre_g)[]; /* odd multiples of the generator */
|
||||
#ifdef USE_ENDOMORPHISM
|
||||
secp256k1_ge_storage_t (*pre_g_128)[]; /* odd multiples of 2^128*generator */
|
||||
#endif
|
||||
} secp256k1_ecmult_context_t;
|
||||
|
||||
static void secp256k1_ecmult_context_init(secp256k1_ecmult_context_t *ctx);
|
||||
static void secp256k1_ecmult_context_build(secp256k1_ecmult_context_t *ctx);
|
||||
static void secp256k1_ecmult_context_clear(secp256k1_ecmult_context_t *ctx);
|
||||
static int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context_t *ctx);
|
||||
|
||||
/** Double multiply: R = na*A + ng*G */
|
||||
static void secp256k1_ecmult(secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_scalar_t *na, const secp256k1_scalar_t *ng);
|
||||
static void secp256k1_ecmult(const secp256k1_ecmult_context_t *ctx, secp256k1_gej_t *r, const secp256k1_gej_t *a, const secp256k1_scalar_t *na, const secp256k1_scalar_t *ng);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user