7#ifndef SECP256K1_ECMULT_GEN_H
8#define SECP256K1_ECMULT_GEN_H
37#if defined(EXHAUSTIVE_TEST_ORDER)
43# if EXHAUSTIVE_TEST_ORDER == 7
47# elif EXHAUSTIVE_TEST_ORDER == 13
51# elif EXHAUSTIVE_TEST_ORDER == 199
56# error "Unknown exhaustive test order"
58# if (COMB_RANGE >= 32) || ((EXHAUSTIVE_TEST_ORDER >> (COMB_RANGE - 1)) != 1)
59# error "COMB_RANGE != ceil(log2(EXHAUSTIVE_TEST_ORDER+1))"
62# define COMB_RANGE 256
67# define COMB_BLOCKS 11
69# pragma message DEBUG_CONFIG_MSG("COMB_BLOCKS undefined, assuming default value")
75# pragma message DEBUG_CONFIG_MSG("COMB_TEETH undefined, assuming default value")
79#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
85#define COMB_BITS (COMB_BLOCKS * COMB_TEETH * COMB_SPACING)
87#define COMB_POINTS (1 << (COMB_TEETH - 1))
90#if !(1 <= COMB_BLOCKS && COMB_BLOCKS <= 256)
91# error "COMB_BLOCKS must be in the range [1, 256]"
93#if !(1 <= COMB_TEETH && COMB_TEETH <= 8)
94# error "COMB_TEETH must be in the range [1, 8]"
96#if COMB_BITS < COMB_RANGE
97# error "COMB_BLOCKS * COMB_TEETH * COMB_SPACING is too low"
104#if (COMB_BLOCKS - 1) * COMB_TEETH * COMB_SPACING >= 256
105# error "COMB_BLOCKS can be reduced"
107#if COMB_BLOCKS * (COMB_TEETH - 1) * COMB_SPACING >= 256
108# error "COMB_TEETH can be reduced"
112# pragma message DEBUG_CONFIG_DEF(COMB_RANGE)
113# pragma message DEBUG_CONFIG_DEF(COMB_BLOCKS)
114# pragma message DEBUG_CONFIG_DEF(COMB_TEETH)
115# pragma message DEBUG_CONFIG_DEF(COMB_SPACING)
static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx)
static void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const secp256k1_hash_ctx *hash_ctx, const unsigned char *seed32)
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.
static void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx, const secp256k1_hash_ctx *hash_ctx)
secp256k1_scalar scalar_offset
This field implementation represents the value as 10 uint32_t limbs in base 2^26.
A group element in affine coordinates on the secp256k1 curve, or occasionally on an isomorphic curve ...
A group element of the secp256k1 curve, in jacobian coordinates.
A scalar modulo the group order of the secp256k1 curve.