Bitcoin Core  0.20.99
P2P Digital Currency
Functions
num.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void secp256k1_num_copy (secp256k1_num *r, const secp256k1_num *a)
 Copy a number. More...
 
static void secp256k1_num_get_bin (unsigned char *r, unsigned int rlen, const secp256k1_num *a)
 Convert a number's absolute value to a binary big-endian string. More...
 
static void secp256k1_num_set_bin (secp256k1_num *r, const unsigned char *a, unsigned int alen)
 Set a number to the value of a binary big-endian string. More...
 
static void secp256k1_num_mod_inverse (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *m)
 Compute a modular inverse. More...
 
static int secp256k1_num_jacobi (const secp256k1_num *a, const secp256k1_num *b)
 Compute the jacobi symbol (a|b). More...
 
static int secp256k1_num_cmp (const secp256k1_num *a, const secp256k1_num *b)
 Compare the absolute value of two numbers. More...
 
static int secp256k1_num_eq (const secp256k1_num *a, const secp256k1_num *b)
 Test whether two number are equal (including sign). More...
 
static void secp256k1_num_add (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 Add two (signed) numbers. More...
 
static void secp256k1_num_sub (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 Subtract two (signed) numbers. More...
 
static void secp256k1_num_mul (secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b)
 Multiply two (signed) numbers. More...
 
static void secp256k1_num_mod (secp256k1_num *r, const secp256k1_num *m)
 Replace a number by its remainder modulo m. More...
 
static void secp256k1_num_shift (secp256k1_num *r, int bits)
 Right-shift the passed number by bits bits. More...
 
static int secp256k1_num_is_zero (const secp256k1_num *a)
 Check whether a number is zero. More...
 
static int secp256k1_num_is_one (const secp256k1_num *a)
 Check whether a number is one. More...
 
static int secp256k1_num_is_neg (const secp256k1_num *a)
 Check whether a number is strictly negative. More...
 
static void secp256k1_num_negate (secp256k1_num *r)
 Change a number's sign. More...
 

Function Documentation

◆ secp256k1_num_add()

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

Add two (signed) numbers.

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

Compare the absolute value of two numbers.

Here is the caller graph for this function:

◆ secp256k1_num_copy()

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

Copy a number.

Here is the caller graph for this function:

◆ secp256k1_num_eq()

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

Test whether two number are equal (including sign).

Here is the caller 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

Convert a number's absolute value to a binary big-endian string.

There must be enough place.

Here is the caller graph for this function:

◆ secp256k1_num_is_neg()

static int secp256k1_num_is_neg ( const secp256k1_num a)
static

Check whether a number is strictly negative.

Here is the caller graph for this function:

◆ secp256k1_num_is_one()

static int secp256k1_num_is_one ( const secp256k1_num a)
static

Check whether a number is one.

Here is the caller graph for this function:

◆ secp256k1_num_is_zero()

static int secp256k1_num_is_zero ( const secp256k1_num a)
static

Check whether a number is zero.

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

Compute the jacobi symbol (a|b).

b must be positive and odd.

Here is the caller graph for this function:

◆ secp256k1_num_mod()

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

Replace a number by its remainder modulo m.

M's sign is ignored. The result is a number between 0 and m-1, even if r was negative.

Here is the caller 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

Compute a modular inverse.

The input must be less than the modulus.

Here is the caller graph for this function:

◆ secp256k1_num_mul()

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

Multiply two (signed) numbers.

Here is the caller graph for this function:

◆ secp256k1_num_negate()

static void secp256k1_num_negate ( secp256k1_num r)
static

Change a number's sign.

Here is the caller graph for this function:

◆ secp256k1_num_set_bin()

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

Set a number to the value of a binary big-endian string.

Here is the caller graph for this function:

◆ secp256k1_num_shift()

static void secp256k1_num_shift ( secp256k1_num r,
int  bits 
)
static

Right-shift the passed number by bits bits.

Here is the caller graph for this function:

◆ secp256k1_num_sub()

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

Subtract two (signed) numbers.

Here is the caller graph for this function: