0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-15 11:36:00 -05:00
bitcoin-bitcoin-core/src/ecmult.h

32 lines
1.4 KiB
C
Raw Normal View History

/**********************************************************************
* Copyright (c) 2013, 2014 Pieter Wuille *
* Distributed under the MIT software license, see the accompanying *
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
**********************************************************************/
2013-05-09 15:24:32 +02:00
2013-03-08 02:52:50 +01:00
#ifndef _SECP256K1_ECMULT_
#define _SECP256K1_ECMULT_
2013-03-10 04:24:00 +01:00
#include "num.h"
2013-03-31 17:02:52 +02:00
#include "group.h"
2013-03-08 02:52:50 +01:00
typedef struct {
/* For accelerating the computation of a*P + b*G: */
2015-09-21 20:57:54 +02:00
secp256k1_ge_storage (*pre_g)[]; /* odd multiples of the generator */
#ifdef USE_ENDOMORPHISM
2015-09-21 20:57:54 +02:00
secp256k1_ge_storage (*pre_g_128)[]; /* odd multiples of 2^128*generator */
#endif
2015-09-21 20:57:54 +02:00
} secp256k1_ecmult_context;
2015-09-21 20:57:54 +02:00
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);
2013-04-01 06:29:30 +02:00
/** Double multiply: R = na*A + ng*G */
2015-09-21 20:57:54 +02:00
static void secp256k1_ecmult(const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng);
2013-03-09 22:47:40 +01:00
2013-03-08 02:52:50 +01:00
#endif