Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

field_10x26_impl.h File Reference
#include "util.h"
#include "field.h"
+ Include dependency graph for field_10x26_impl.h:

Go to the source code of this file.

Macros

#define VERIFY_BITS(x, n)   do { } while(0)
 

Functions

static void secp256k1_fe_normalize (secp256k1_fe *r)
 
static void secp256k1_fe_normalize_weak (secp256k1_fe *r)
 
static void secp256k1_fe_normalize_var (secp256k1_fe *r)
 
static int secp256k1_fe_normalizes_to_zero (secp256k1_fe *r)
 
static int secp256k1_fe_normalizes_to_zero_var (secp256k1_fe *r)
 
static SECP256K1_INLINE void secp256k1_fe_set_int (secp256k1_fe *r, int a)
 
static SECP256K1_INLINE int secp256k1_fe_is_zero (const secp256k1_fe *a)
 
static SECP256K1_INLINE int secp256k1_fe_is_odd (const secp256k1_fe *a)
 
static SECP256K1_INLINE void secp256k1_fe_clear (secp256k1_fe *a)
 
static int secp256k1_fe_cmp_var (const secp256k1_fe *a, const secp256k1_fe *b)
 
static int secp256k1_fe_set_b32 (secp256k1_fe *r, const unsigned char *a)
 
static void secp256k1_fe_get_b32 (unsigned char *r, const secp256k1_fe *a)
 Convert a field element to a 32-byte big endian value. More...
 
static SECP256K1_INLINE void secp256k1_fe_negate (secp256k1_fe *r, const secp256k1_fe *a, int m)
 
static SECP256K1_INLINE void secp256k1_fe_mul_int (secp256k1_fe *r, int a)
 
static SECP256K1_INLINE void secp256k1_fe_add (secp256k1_fe *r, const secp256k1_fe *a)
 
static SECP256K1_INLINE void secp256k1_fe_mul_inner (uint32_t *r, const uint32_t *a, const uint32_t *SECP256K1_RESTRICT b)
 
static SECP256K1_INLINE void secp256k1_fe_sqr_inner (uint32_t *r, const uint32_t *a)
 
static void secp256k1_fe_mul (secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe *SECP256K1_RESTRICT b)
 
static void secp256k1_fe_sqr (secp256k1_fe *r, const secp256k1_fe *a)
 
static SECP256K1_INLINE void secp256k1_fe_cmov (secp256k1_fe *r, const secp256k1_fe *a, int flag)
 
static SECP256K1_INLINE void secp256k1_fe_storage_cmov (secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag)
 
static void secp256k1_fe_to_storage (secp256k1_fe_storage *r, const secp256k1_fe *a)
 
static SECP256K1_INLINE void secp256k1_fe_from_storage (secp256k1_fe *r, const secp256k1_fe_storage *a)
 

Macro Definition Documentation

◆ VERIFY_BITS

#define VERIFY_BITS (   x,
 
)    do { } while(0)

Definition at line 457 of file field_10x26_impl.h.

Referenced by secp256k1_fe_mul_inner(), and secp256k1_fe_sqr_inner().

Function Documentation

◆ secp256k1_fe_add()

static SECP256K1_INLINE void secp256k1_fe_add ( secp256k1_fe r,
const secp256k1_fe a 
)
static

Definition at line 425 of file field_10x26_impl.h.

References secp256k1_fe::n.

◆ secp256k1_fe_clear()

static SECP256K1_INLINE void secp256k1_fe_clear ( secp256k1_fe a)
static

Definition at line 292 of file field_10x26_impl.h.

References secp256k1_fe::n.

◆ secp256k1_fe_cmov()

static SECP256K1_INLINE void secp256k1_fe_cmov ( secp256k1_fe r,
const secp256k1_fe a,
int  flag 
)
static

Definition at line 1095 of file field_10x26_impl.h.

References secp256k1_fe::n.

◆ secp256k1_fe_cmp_var()

static int secp256k1_fe_cmp_var ( const secp256k1_fe a,
const secp256k1_fe b 
)
static

Definition at line 303 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_from_storage()

static SECP256K1_INLINE void secp256k1_fe_from_storage ( secp256k1_fe r,
const secp256k1_fe_storage a 
)
static

Definition at line 1145 of file field_10x26_impl.h.

References secp256k1_fe::n, and secp256k1_fe_storage::n.

◆ secp256k1_fe_get_b32()

static void secp256k1_fe_get_b32 ( unsigned char *  r,
const secp256k1_fe a 
)
static

Convert a field element to a 32-byte big endian value.

Requires the input to be normalized

Definition at line 346 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_is_odd()

static SECP256K1_INLINE int secp256k1_fe_is_odd ( const secp256k1_fe a)
static

Definition at line 284 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_is_zero()

static SECP256K1_INLINE int secp256k1_fe_is_zero ( const secp256k1_fe a)
static

Definition at line 275 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_mul()

static void secp256k1_fe_mul ( secp256k1_fe r,
const secp256k1_fe a,
const secp256k1_fe *SECP256K1_RESTRICT  b 
)
static

Definition at line 1065 of file field_10x26_impl.h.

References secp256k1_fe::n, secp256k1_fe_mul_inner(), and VERIFY_CHECK.

◆ secp256k1_fe_mul_inner()

static SECP256K1_INLINE void secp256k1_fe_mul_inner ( uint32_t *  r,
const uint32_t *  a,
const uint32_t *SECP256K1_RESTRICT  b 
)
static

[... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n. for 0 <= x <= 9, px is a shorthand for sum(a[i]*b[x-i], i=0..x). for 9 <= x <= 18, px is a shorthand for sum(a[i]*b[x-i], i=(x-9)..9) Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0].

Definition at line 460 of file field_10x26_impl.h.

References M, VERIFY_BITS, and VERIFY_CHECK.

Referenced by secp256k1_fe_mul().

◆ secp256k1_fe_mul_int()

static SECP256K1_INLINE void secp256k1_fe_mul_int ( secp256k1_fe r,
int  a 
)
static

Definition at line 407 of file field_10x26_impl.h.

References secp256k1_fe::n.

◆ secp256k1_fe_negate()

static SECP256K1_INLINE void secp256k1_fe_negate ( secp256k1_fe r,
const secp256k1_fe a,
int  m 
)
static

Definition at line 385 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_normalize()

static void secp256k1_fe_normalize ( secp256k1_fe r)
static

Definition at line 42 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_normalize_var()

static void secp256k1_fe_normalize_var ( secp256k1_fe r)
static

Definition at line 128 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_normalize_weak()

static void secp256k1_fe_normalize_weak ( secp256k1_fe r)
static

Definition at line 97 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_normalizes_to_zero()

static int secp256k1_fe_normalizes_to_zero ( secp256k1_fe r)
static

Definition at line 184 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_normalizes_to_zero_var()

static int secp256k1_fe_normalizes_to_zero_var ( secp256k1_fe r)
static

Definition at line 213 of file field_10x26_impl.h.

References secp256k1_fe::n, and VERIFY_CHECK.

◆ secp256k1_fe_set_b32()

static int secp256k1_fe_set_b32 ( secp256k1_fe r,
const unsigned char *  a 
)
static

Definition at line 322 of file field_10x26_impl.h.

References secp256k1_fe::n.

◆ secp256k1_fe_set_int()

static SECP256K1_INLINE void secp256k1_fe_set_int ( secp256k1_fe r,
int  a 
)
static

Definition at line 265 of file field_10x26_impl.h.

References secp256k1_fe::n.

◆ secp256k1_fe_sqr()

static void secp256k1_fe_sqr ( secp256k1_fe r,
const secp256k1_fe a 
)
static

Definition at line 1082 of file field_10x26_impl.h.

References secp256k1_fe::n, secp256k1_fe_sqr_inner(), and VERIFY_CHECK.

◆ secp256k1_fe_sqr_inner()

static SECP256K1_INLINE void secp256k1_fe_sqr_inner ( uint32_t *  r,
const uint32_t *  a 
)
static

[... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n. px is a shorthand for sum(a[i]*a[x-i], i=0..x). Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0].

Definition at line 790 of file field_10x26_impl.h.

References M, VERIFY_BITS, and VERIFY_CHECK.

Referenced by secp256k1_fe_sqr().

◆ secp256k1_fe_storage_cmov()

static SECP256K1_INLINE void secp256k1_fe_storage_cmov ( secp256k1_fe_storage r,
const secp256k1_fe_storage a,
int  flag 
)
static

Definition at line 1117 of file field_10x26_impl.h.

References secp256k1_fe_storage::n.

◆ secp256k1_fe_to_storage()

static void secp256k1_fe_to_storage ( secp256k1_fe_storage r,
const secp256k1_fe a 
)
static

Definition at line 1131 of file field_10x26_impl.h.

References secp256k1_fe::n, secp256k1_fe_storage::n, and VERIFY_CHECK.

Released under the MIT license