Bitcoin ABC
0.32.7
P2P Digital Currency
src
secp256k1
src
ecmult_gen.h
Go to the documentation of this file.
1
/***********************************************************************
2
* Copyright (c) 2013, 2014 Pieter Wuille *
3
* Distributed under the MIT software license, see the accompanying *
4
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
5
***********************************************************************/
6
7
#ifndef SECP256K1_ECMULT_GEN_H
8
#define SECP256K1_ECMULT_GEN_H
9
10
#include "
scalar.h
"
11
#include "
group.h
"
12
13
#ifndef ECMULT_GEN_PREC_BITS
14
# define ECMULT_GEN_PREC_BITS 4
15
#endif
16
#if ECMULT_GEN_PREC_BITS != 2 && ECMULT_GEN_PREC_BITS != 4 && ECMULT_GEN_PREC_BITS != 8
17
# error "Set ECMULT_GEN_PREC_BITS to 2, 4 or 8."
18
#endif
19
#define ECMULT_GEN_PREC_G(bits) (1 << bits)
20
#define ECMULT_GEN_PREC_N(bits) (256 / bits)
21
22
typedef
struct
{
23
/* Whether the context has been built. */
24
int
built
;
25
26
/* Blinding values used when computing (n-b)G + bG. */
27
secp256k1_scalar
blind
;
/* -b */
28
secp256k1_gej
initial
;
/* bG */
29
}
secp256k1_ecmult_gen_context
;
30
31
static
void
secp256k1_ecmult_gen_context_build
(
secp256k1_ecmult_gen_context
*
ctx
);
32
static
void
secp256k1_ecmult_gen_context_clear
(
secp256k1_ecmult_gen_context
*
ctx
);
33
35
static
void
secp256k1_ecmult_gen
(
const
secp256k1_ecmult_gen_context
*
ctx
,
secp256k1_gej
*r,
const
secp256k1_scalar
*a);
36
37
static
void
secp256k1_ecmult_gen_blind
(
secp256k1_ecmult_gen_context
*
ctx
,
const
unsigned
char
*seed32);
38
39
#endif
/* SECP256K1_ECMULT_GEN_H */
secp256k1_ecmult_gen_context_clear
static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx)
secp256k1_ecmult_gen_context_build
static void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx)
secp256k1_ecmult_gen
static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *a)
Multiply with the generator: R = a*G.
secp256k1_ecmult_gen_blind
static void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const unsigned char *seed32)
group.h
ctx
secp256k1_context * ctx
Definition:
bench_impl.h:13
scalar.h
secp256k1_ecmult_gen_context
Definition:
ecmult_gen.h:22
secp256k1_ecmult_gen_context::initial
secp256k1_gej initial
Definition:
ecmult_gen.h:28
secp256k1_ecmult_gen_context::built
int built
Definition:
ecmult_gen.h:24
secp256k1_ecmult_gen_context::blind
secp256k1_scalar blind
Definition:
ecmult_gen.h:27
secp256k1_gej
A group element of the secp256k1 curve, in jacobian coordinates.
Definition:
group.h:23
secp256k1_scalar
A scalar modulo the group order of the secp256k1 curve.
Definition:
scalar_4x64.h:13
Generated on Mon Jan 26 2026 20:04:56 for Bitcoin ABC by
1.9.4