7 #ifndef _SECP256K1_ECMULT_GEN_IMPL_H_ 8 #define _SECP256K1_ECMULT_GEN_IMPL_H_ 14 #ifdef USE_ECMULT_STATIC_PRECOMPUTATION 22 #ifndef USE_ECMULT_STATIC_PRECOMPUTATION 29 if (
ctx->prec != NULL) {
32 #ifndef USE_ECMULT_STATIC_PRECOMPUTATION 40 static const unsigned char nums_b32[33] =
"The scalar for this x is unknown";
62 for (j = 0; j < 64; j++) {
64 precj[j*16] = numsbase;
65 for (i = 1; i < 16; i++) {
69 for (i = 0; i < 4; i++) {
82 for (j = 0; j < 64; j++) {
83 for (i = 0; i < 16; i++) {
95 return ctx->prec != NULL;
100 if (src->
prec == NULL) {
103 #ifndef USE_ECMULT_STATIC_PRECOMPUTATION 116 #ifndef USE_ECMULT_STATIC_PRECOMPUTATION 130 memset(&adds, 0,
sizeof(adds));
135 for (j = 0; j < 64; j++) {
137 for (i = 0; i < 16; i++) {
163 unsigned char nonce32[32];
166 unsigned char keydata[64] = {0};
167 if (seed32 == NULL) {
179 memcpy(keydata, nonce32, 32);
180 if (seed32 != NULL) {
181 memcpy(keydata + 32, seed32, 32);
184 memset(keydata, 0,
sizeof(keydata));
201 memset(nonce32, 0, 32);
#define VERIFY_CHECK(cond)
static SECP256K1_INLINE void secp256k1_fe_clear(secp256k1_fe *a)
static void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr)
static int secp256k1_fe_is_zero(const secp256k1_fe *a)
static void secp256k1_rfc6979_hmac_sha256_initialize(secp256k1_rfc6979_hmac_sha256_t *rng, const unsigned char *key, size_t keylen)
static void secp256k1_ecmult_gen_context_clone(secp256k1_ecmult_gen_context *dst, const secp256k1_ecmult_gen_context *src, const secp256k1_callback *cb)
static unsigned int secp256k1_scalar_get_bits(const secp256k1_scalar *a, unsigned int offset, unsigned int count)
static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a)
static int secp256k1_scalar_is_zero(const secp256k1_scalar *a)
static void secp256k1_gej_neg(secp256k1_gej *r, const secp256k1_gej *a)
static void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256_t *rng, unsigned char *out, size_t outlen)
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *bin, int *overflow)
static void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr)
static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr)
static const secp256k1_ge secp256k1_ge_const_g
static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn)
static void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256_t *rng)
static void secp256k1_ecmult_gen_context_init(secp256k1_ecmult_gen_context *ctx)
static secp256k1_context * ctx
static void secp256k1_gej_clear(secp256k1_gej *r)
static void secp256k1_scalar_clear(secp256k1_scalar *r)
static void secp256k1_ge_clear(secp256k1_ge *r)
static void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag)
static void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const unsigned char *seed32)
static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context *ctx)
static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar *a)
static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd)
static int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a)
static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *b)
static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b)
static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v)
static void secp256k1_ge_set_all_gej_var(size_t len, secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_callback *cb)
void * memcpy(void *a, const void *b, size_t c)
static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx)
static void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx, const secp256k1_callback *cb)
secp256k1_ge_storage(* prec)[64][16]
static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b)
static const secp256k1_ge_storage secp256k1_ecmult_static_context[64][16]
static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a)
static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a)
static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a)
static SECP256K1_INLINE void * checked_malloc(const secp256k1_callback *cb, size_t size)