Bitcoin Core  0.21.1
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
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

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:

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:

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

Copy a number.

Here is the caller graph for this function:

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:

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:

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:

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:

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:

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:

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:

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:

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:

static void secp256k1_num_negate ( secp256k1_num r)
static

Change a number's sign.

Here is the caller graph for this function:

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:

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:

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: