Bitcoin Core  0.19.99
P2P Digital Currency
Macros | Functions
num_gmp_impl.h File Reference
#include <string.h>
#include <stdlib.h>
#include <gmp.h>
#include "util.h"
#include "num.h"
Include dependency graph for num_gmp_impl.h:

Go to the source code of this file.

Macros

#define secp256k1_num_sanity(a)   do { } while(0)
 

Functions

static void secp256k1_num_copy (secp256k1_num *r, const secp256k1_num *a)
 
static void secp256k1_num_get_bin (unsigned char *r, unsigned int rlen, const secp256k1_num *a)
 
static void secp256k1_num_set_bin (secp256k1_num *r, const unsigned char *a, unsigned int alen)
 
static void secp256k1_num_add_abs (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 
static void secp256k1_num_sub_abs (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 
static void secp256k1_num_mod (secp256k1_num *r, const secp256k1_num *m)
 
static void secp256k1_num_mod_inverse (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *m)
 
static int secp256k1_num_jacobi (const secp256k1_num *a, const secp256k1_num *b)
 
static int secp256k1_num_is_one (const secp256k1_num *a)
 
static int secp256k1_num_is_zero (const secp256k1_num *a)
 
static int secp256k1_num_is_neg (const secp256k1_num *a)
 
static int secp256k1_num_cmp (const secp256k1_num *a, const secp256k1_num *b)
 
static int secp256k1_num_eq (const secp256k1_num *a, const secp256k1_num *b)
 
static void secp256k1_num_subadd (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b, int bneg)
 
static void secp256k1_num_add (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 
static void secp256k1_num_sub (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 
static void secp256k1_num_mul (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 
static void secp256k1_num_shift (secp256k1_num *r, int bits)
 
static void secp256k1_num_negate (secp256k1_num *r)
 

Macro Definition Documentation

◆ secp256k1_num_sanity

#define secp256k1_num_sanity (   a)    do { } while(0)

Definition at line 22 of file num_gmp_impl.h.

Function Documentation

◆ secp256k1_num_add()

static void secp256k1_num_add ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 223 of file num_gmp_impl.h.

Here is the call graph for this function:

◆ secp256k1_num_add_abs()

static void secp256k1_num_add_abs ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 62 of file num_gmp_impl.h.

Here is the caller graph for this function:

◆ secp256k1_num_cmp()

static int secp256k1_num_cmp ( const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 181 of file num_gmp_impl.h.

Here is the caller graph for this function:

◆ secp256k1_num_copy()

static void secp256k1_num_copy ( secp256k1_num r,
const secp256k1_num a 
)
static

Definition at line 25 of file num_gmp_impl.h.

◆ secp256k1_num_eq()

static int secp256k1_num_eq ( const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 191 of file num_gmp_impl.h.

Here is the call graph for this function:

◆ secp256k1_num_get_bin()

static void secp256k1_num_get_bin ( unsigned char *  r,
unsigned int  rlen,
const secp256k1_num a 
)
static

Definition at line 29 of file num_gmp_impl.h.

Here is the call graph for this function:

◆ secp256k1_num_is_neg()

static int secp256k1_num_is_neg ( const secp256k1_num a)
static

Definition at line 177 of file num_gmp_impl.h.

◆ secp256k1_num_is_one()

static int secp256k1_num_is_one ( const secp256k1_num a)
static

Definition at line 169 of file num_gmp_impl.h.

◆ secp256k1_num_is_zero()

static int secp256k1_num_is_zero ( const secp256k1_num a)
static

Definition at line 173 of file num_gmp_impl.h.

Here is the caller graph for this function:

◆ secp256k1_num_jacobi()

static int secp256k1_num_jacobi ( const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 147 of file num_gmp_impl.h.

◆ secp256k1_num_mod()

static void secp256k1_num_mod ( secp256k1_num r,
const secp256k1_num m 
)
static

Definition at line 81 of file num_gmp_impl.h.

Here is the call graph for this function:

◆ secp256k1_num_mod_inverse()

static void secp256k1_num_mod_inverse ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num m 
)
static

mpn_gcdext computes: (G,S) = gcdext(U,V), where

  • G = gcd(U,V)
  • G = U*S + V*T
  • U has equal or more limbs than V, and V has no padding If we set U to be (a padded version of) a, and V = m: G = a*S + m*T G = a*S mod m Assuming G=1: S = 1/a mod m

Definition at line 101 of file num_gmp_impl.h.

◆ secp256k1_num_mul()

static void secp256k1_num_mul ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 235 of file num_gmp_impl.h.

◆ secp256k1_num_negate()

static void secp256k1_num_negate ( secp256k1_num r)
static

Definition at line 284 of file num_gmp_impl.h.

◆ secp256k1_num_set_bin()

static void secp256k1_num_set_bin ( secp256k1_num r,
const unsigned char *  a,
unsigned int  alen 
)
static

Definition at line 45 of file num_gmp_impl.h.

◆ secp256k1_num_shift()

static void secp256k1_num_shift ( secp256k1_num r,
int  bits 
)
static

Definition at line 262 of file num_gmp_impl.h.

◆ secp256k1_num_sub()

static void secp256k1_num_sub ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 229 of file num_gmp_impl.h.

Here is the call graph for this function:

◆ secp256k1_num_sub_abs()

static void secp256k1_num_sub_abs ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num b 
)
static

Definition at line 71 of file num_gmp_impl.h.

Here is the caller graph for this function:

◆ secp256k1_num_subadd()

static void secp256k1_num_subadd ( secp256k1_num r,
const secp256k1_num a,
const secp256k1_num b,
int  bneg 
)
static

Definition at line 204 of file num_gmp_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function: