Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

ecmult_gen_impl.h File Reference
#include "scalar.h"
#include "group.h"
#include "ecmult_gen.h"
#include "hash_impl.h"
+ Include dependency graph for ecmult_gen_impl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void secp256k1_ecmult_gen_context_init (secp256k1_ecmult_gen_context *ctx)
 
static void secp256k1_ecmult_gen_context_build (secp256k1_ecmult_gen_context *ctx, const secp256k1_callback *cb)
 
static int secp256k1_ecmult_gen_context_is_built (const secp256k1_ecmult_gen_context *ctx)
 
static void secp256k1_ecmult_gen_context_clone (secp256k1_ecmult_gen_context *dst, const secp256k1_ecmult_gen_context *src, const secp256k1_callback *cb)
 
static void secp256k1_ecmult_gen_context_clear (secp256k1_ecmult_gen_context *ctx)
 
static void secp256k1_ecmult_gen (const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn)
 
static void secp256k1_ecmult_gen_blind (secp256k1_ecmult_gen_context *ctx, const unsigned char *seed32)
 

Function Documentation

◆ secp256k1_ecmult_gen()

static void secp256k1_ecmult_gen ( const secp256k1_ecmult_gen_context ctx,
secp256k1_gej r,
const secp256k1_scalar gn 
)
static

This uses a conditional move to avoid any secret data in array indexes. Any use of secret indexes has been demonstrated to result in timing sidechannels, even when the cache-line access patterns are uniform. See also: "A word of warning", CHES 2013 Rump Session, by Daniel J. Bernstein and Peter Schwabe (https://cryptojedi.org/peter/data/chesrump-20130822.pdf) and "Cache Attacks and Countermeasures: the Case of AES", RSA 2006, by Dag Arne Osvik, Adi Shamir, and Eran Tromer (http://www.tau.ac.il/~tromer/papers/cache.pdf)

Definition at line 124 of file ecmult_gen_impl.h.

References immer::detail::rbts::bits, ctx, secp256k1_ge::infinity, secp256k1_ge_clear(), secp256k1_ge_from_storage(), secp256k1_ge_storage_cmov(), secp256k1_gej_add_ge(), secp256k1_scalar_add(), secp256k1_scalar_clear(), and secp256k1_scalar_get_bits().

Referenced by secp256k1_ecmult_gen_blind().

◆ secp256k1_ecmult_gen_blind()

static void secp256k1_ecmult_gen_blind ( secp256k1_ecmult_gen_context ctx,
const unsigned char *  seed32 
)
static

Using a CSPRNG allows a failure free interface, avoids needing large amounts of random data, and guards against weak or adversarial seeds. This is a simpler and safer interface than asking the caller for blinding values directly and expecting them to retry on failure.

Definition at line 159 of file ecmult_gen_impl.h.

References ctx, memcpy(), secp256k1_ecmult_gen(), secp256k1_fe_clear(), secp256k1_fe_is_zero(), secp256k1_fe_set_b32(), secp256k1_ge_const_g, secp256k1_gej_clear(), secp256k1_gej_neg(), secp256k1_gej_rescale(), secp256k1_gej_set_ge(), secp256k1_rfc6979_hmac_sha256_finalize(), secp256k1_rfc6979_hmac_sha256_generate(), secp256k1_rfc6979_hmac_sha256_initialize(), secp256k1_scalar_clear(), secp256k1_scalar_get_b32(), secp256k1_scalar_is_zero(), secp256k1_scalar_negate(), secp256k1_scalar_set_b32(), and secp256k1_scalar_set_int().

Referenced by secp256k1_ecmult_gen_context_build().

◆ secp256k1_ecmult_gen_context_build()

◆ secp256k1_ecmult_gen_context_clear()

static void secp256k1_ecmult_gen_context_clear ( secp256k1_ecmult_gen_context ctx)
static

Definition at line 115 of file ecmult_gen_impl.h.

References ctx, secp256k1_gej_clear(), and secp256k1_scalar_clear().

◆ secp256k1_ecmult_gen_context_clone()

static void secp256k1_ecmult_gen_context_clone ( secp256k1_ecmult_gen_context dst,
const secp256k1_ecmult_gen_context src,
const secp256k1_callback cb 
)
static

◆ secp256k1_ecmult_gen_context_init()

static void secp256k1_ecmult_gen_context_init ( secp256k1_ecmult_gen_context ctx)
static

Definition at line 17 of file ecmult_gen_impl.h.

References ctx.

◆ secp256k1_ecmult_gen_context_is_built()

static int secp256k1_ecmult_gen_context_is_built ( const secp256k1_ecmult_gen_context ctx)
static

Definition at line 94 of file ecmult_gen_impl.h.

References ctx.

Released under the MIT license