nettle  3.7.3
About: Nettle is a low-level cryptographic library.
  Fossies Dox: nettle-3.7.3.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mini-gmp.h File Reference
#include <stddef.h>
Include dependency graph for mini-gmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  __mpz_struct
 

Macros

#define MINI_GMP_LIMB_TYPE   long
 
#define mpn_invert_limb(x)   mpn_invert_3by2 ((x), 0)
 
#define mpz_odd_p(z)   (((z)->_mp_size != 0) & (int) (z)->_mp_d[0])
 
#define mpz_even_p(z)   (! mpz_odd_p (z))
 
#define MPZ_ROINIT_N(xp, xs)   {{0, (xs),(xp) }}
 

Typedefs

typedef unsigned long mp_limb_t
 
typedef long mp_size_t
 
typedef unsigned long mp_bitcnt_t
 
typedef mp_limb_tmp_ptr
 
typedef const mp_limb_tmp_srcptr
 
typedef __mpz_struct mpz_t[1]
 
typedef __mpz_structmpz_ptr
 
typedef const __mpz_structmpz_srcptr
 

Functions

void mp_set_memory_functions (void *(*)(size_t), void *(*)(void *, size_t, size_t), void(*)(void *, size_t))
 
void mp_get_memory_functions (void *(**)(size_t), void *(**)(void *, size_t, size_t), void(**)(void *, size_t))
 
void mpn_copyi (mp_ptr, mp_srcptr, mp_size_t)
 
void mpn_copyd (mp_ptr, mp_srcptr, mp_size_t)
 
void mpn_zero (mp_ptr, mp_size_t)
 
int mpn_cmp (mp_srcptr, mp_srcptr, mp_size_t)
 
int mpn_zero_p (mp_srcptr, mp_size_t)
 
mp_limb_t mpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
 
mp_limb_t mpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
 
mp_limb_t mpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t)
 
mp_limb_t mpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
 
mp_limb_t mpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
 
mp_limb_t mpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t)
 
mp_limb_t mpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
 
mp_limb_t mpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
 
mp_limb_t mpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
 
mp_limb_t mpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t)
 
void mpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)
 
void mpn_sqr (mp_ptr, mp_srcptr, mp_size_t)
 
int mpn_perfect_square_p (mp_srcptr, mp_size_t)
 
mp_size_t mpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t)
 
mp_limb_t mpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int)
 
mp_limb_t mpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int)
 
mp_bitcnt_t mpn_scan0 (mp_srcptr, mp_bitcnt_t)
 
mp_bitcnt_t mpn_scan1 (mp_srcptr, mp_bitcnt_t)
 
void mpn_com (mp_ptr, mp_srcptr, mp_size_t)
 
mp_limb_t mpn_neg (mp_ptr, mp_srcptr, mp_size_t)
 
mp_bitcnt_t mpn_popcount (mp_srcptr, mp_size_t)
 
mp_limb_t mpn_invert_3by2 (mp_limb_t, mp_limb_t)
 
size_t mpn_get_str (unsigned char *, int, mp_ptr, mp_size_t)
 
mp_size_t mpn_set_str (mp_ptr, const unsigned char *, size_t, int)
 
void mpz_init (mpz_t)
 
void mpz_init2 (mpz_t, mp_bitcnt_t)
 
void mpz_clear (mpz_t)
 
int mpz_sgn (const mpz_t)
 
int mpz_cmp_si (const mpz_t, long)
 
int mpz_cmp_ui (const mpz_t, unsigned long)
 
int mpz_cmp (const mpz_t, const mpz_t)
 
int mpz_cmpabs_ui (const mpz_t, unsigned long)
 
int mpz_cmpabs (const mpz_t, const mpz_t)
 
int mpz_cmp_d (const mpz_t, double)
 
int mpz_cmpabs_d (const mpz_t, double)
 
void mpz_abs (mpz_t, const mpz_t)
 
void mpz_neg (mpz_t, const mpz_t)
 
void mpz_swap (mpz_t, mpz_t)
 
void mpz_add_ui (mpz_t, const mpz_t, unsigned long)
 
void mpz_add (mpz_t, const mpz_t, const mpz_t)
 
void mpz_sub_ui (mpz_t, const mpz_t, unsigned long)
 
void mpz_ui_sub (mpz_t, unsigned long, const mpz_t)
 
void mpz_sub (mpz_t, const mpz_t, const mpz_t)
 
void mpz_mul_si (mpz_t, const mpz_t, long int)
 
void mpz_mul_ui (mpz_t, const mpz_t, unsigned long int)
 
void mpz_mul (mpz_t, const mpz_t, const mpz_t)
 
void mpz_mul_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_addmul_ui (mpz_t, const mpz_t, unsigned long int)
 
void mpz_addmul (mpz_t, const mpz_t, const mpz_t)
 
void mpz_submul_ui (mpz_t, const mpz_t, unsigned long int)
 
void mpz_submul (mpz_t, const mpz_t, const mpz_t)
 
void mpz_cdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t)
 
void mpz_fdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t)
 
void mpz_tdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t)
 
void mpz_cdiv_q (mpz_t, const mpz_t, const mpz_t)
 
void mpz_fdiv_q (mpz_t, const mpz_t, const mpz_t)
 
void mpz_tdiv_q (mpz_t, const mpz_t, const mpz_t)
 
void mpz_cdiv_r (mpz_t, const mpz_t, const mpz_t)
 
void mpz_fdiv_r (mpz_t, const mpz_t, const mpz_t)
 
void mpz_tdiv_r (mpz_t, const mpz_t, const mpz_t)
 
void mpz_cdiv_q_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_fdiv_q_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_tdiv_q_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_cdiv_r_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_fdiv_r_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_tdiv_r_2exp (mpz_t, const mpz_t, mp_bitcnt_t)
 
void mpz_mod (mpz_t, const mpz_t, const mpz_t)
 
void mpz_divexact (mpz_t, const mpz_t, const mpz_t)
 
int mpz_divisible_p (const mpz_t, const mpz_t)
 
int mpz_congruent_p (const mpz_t, const mpz_t, const mpz_t)
 
unsigned long mpz_cdiv_qr_ui (mpz_t, mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_fdiv_qr_ui (mpz_t, mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_tdiv_qr_ui (mpz_t, mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_cdiv_q_ui (mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_fdiv_q_ui (mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_tdiv_q_ui (mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_cdiv_r_ui (mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_fdiv_r_ui (mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_tdiv_r_ui (mpz_t, const mpz_t, unsigned long)
 
unsigned long mpz_cdiv_ui (const mpz_t, unsigned long)
 
unsigned long mpz_fdiv_ui (const mpz_t, unsigned long)
 
unsigned long mpz_tdiv_ui (const mpz_t, unsigned long)
 
unsigned long mpz_mod_ui (mpz_t, const mpz_t, unsigned long)
 
void mpz_divexact_ui (mpz_t, const mpz_t, unsigned long)
 
int mpz_divisible_ui_p (const mpz_t, unsigned long)
 
unsigned long mpz_gcd_ui (mpz_t, const mpz_t, unsigned long)
 
void mpz_gcd (mpz_t, const mpz_t, const mpz_t)
 
void mpz_gcdext (mpz_t, mpz_t, mpz_t, const mpz_t, const mpz_t)
 
void mpz_lcm_ui (mpz_t, const mpz_t, unsigned long)
 
void mpz_lcm (mpz_t, const mpz_t, const mpz_t)
 
int mpz_invert (mpz_t, const mpz_t, const mpz_t)
 
void mpz_sqrtrem (mpz_t, mpz_t, const mpz_t)
 
void mpz_sqrt (mpz_t, const mpz_t)
 
int mpz_perfect_square_p (const mpz_t)
 
void mpz_pow_ui (mpz_t, const mpz_t, unsigned long)
 
void mpz_ui_pow_ui (mpz_t, unsigned long, unsigned long)
 
void mpz_powm (mpz_t, const mpz_t, const mpz_t, const mpz_t)
 
void mpz_powm_ui (mpz_t, const mpz_t, unsigned long, const mpz_t)
 
void mpz_rootrem (mpz_t, mpz_t, const mpz_t, unsigned long)
 
int mpz_root (mpz_t, const mpz_t, unsigned long)
 
void mpz_fac_ui (mpz_t, unsigned long)
 
void mpz_2fac_ui (mpz_t, unsigned long)
 
void mpz_mfac_uiui (mpz_t, unsigned long, unsigned long)
 
void mpz_bin_uiui (mpz_t, unsigned long, unsigned long)
 
int mpz_probab_prime_p (const mpz_t, int)
 
int mpz_tstbit (const mpz_t, mp_bitcnt_t)
 
void mpz_setbit (mpz_t, mp_bitcnt_t)
 
void mpz_clrbit (mpz_t, mp_bitcnt_t)
 
void mpz_combit (mpz_t, mp_bitcnt_t)
 
void mpz_com (mpz_t, const mpz_t)
 
void mpz_and (mpz_t, const mpz_t, const mpz_t)
 
void mpz_ior (mpz_t, const mpz_t, const mpz_t)
 
void mpz_xor (mpz_t, const mpz_t, const mpz_t)
 
mp_bitcnt_t mpz_popcount (const mpz_t)
 
mp_bitcnt_t mpz_hamdist (const mpz_t, const mpz_t)
 
mp_bitcnt_t mpz_scan0 (const mpz_t, mp_bitcnt_t)
 
mp_bitcnt_t mpz_scan1 (const mpz_t, mp_bitcnt_t)
 
int mpz_fits_slong_p (const mpz_t)
 
int mpz_fits_ulong_p (const mpz_t)
 
int mpz_fits_sint_p (const mpz_t)
 
int mpz_fits_uint_p (const mpz_t)
 
int mpz_fits_sshort_p (const mpz_t)
 
int mpz_fits_ushort_p (const mpz_t)
 
long int mpz_get_si (const mpz_t)
 
unsigned long int mpz_get_ui (const mpz_t)
 
double mpz_get_d (const mpz_t)
 
size_t mpz_size (const mpz_t)
 
mp_limb_t mpz_getlimbn (const mpz_t, mp_size_t)
 
void mpz_realloc2 (mpz_t, mp_bitcnt_t)
 
mp_srcptr mpz_limbs_read (mpz_srcptr)
 
mp_ptr mpz_limbs_modify (mpz_t, mp_size_t)
 
mp_ptr mpz_limbs_write (mpz_t, mp_size_t)
 
void mpz_limbs_finish (mpz_t, mp_size_t)
 
mpz_srcptr mpz_roinit_n (mpz_t, mp_srcptr, mp_size_t)
 
void mpz_set_si (mpz_t, signed long int)
 
void mpz_set_ui (mpz_t, unsigned long int)
 
void mpz_set (mpz_t, const mpz_t)
 
void mpz_set_d (mpz_t, double)
 
void mpz_init_set_si (mpz_t, signed long int)
 
void mpz_init_set_ui (mpz_t, unsigned long int)
 
void mpz_init_set (mpz_t, const mpz_t)
 
void mpz_init_set_d (mpz_t, double)
 
size_t mpz_sizeinbase (const mpz_t, int)
 
char * mpz_get_str (char *, int, const mpz_t)
 
int mpz_set_str (mpz_t, const char *, int)
 
int mpz_init_set_str (mpz_t, const char *, int)
 
void mpz_import (mpz_t, size_t, int, size_t, int, size_t, const void *)
 
void * mpz_export (void *, size_t *, int, size_t, int, size_t, const mpz_t)
 

Variables

const int mp_bits_per_limb
 

Macro Definition Documentation

◆ MINI_GMP_LIMB_TYPE

#define MINI_GMP_LIMB_TYPE   long

Definition at line 57 of file mini-gmp.h.

◆ mpn_invert_limb

#define mpn_invert_limb (   x)    mpn_invert_3by2 ((x), 0)

Definition at line 121 of file mini-gmp.h.

◆ mpz_even_p

#define mpz_even_p (   z)    (! mpz_odd_p (z))

Definition at line 131 of file mini-gmp.h.

◆ mpz_odd_p

#define mpz_odd_p (   z)    (((z)->_mp_size != 0) & (int) (z)->_mp_d[0])

Definition at line 130 of file mini-gmp.h.

◆ MPZ_ROINIT_N

#define MPZ_ROINIT_N (   xp,
  xs 
)    {{0, (xs),(xp) }}

Definition at line 264 of file mini-gmp.h.

Typedef Documentation

◆ mp_bitcnt_t

typedef unsigned long mp_bitcnt_t

Definition at line 62 of file mini-gmp.h.

◆ mp_limb_t

typedef unsigned long mp_limb_t

Definition at line 60 of file mini-gmp.h.

◆ mp_ptr

typedef mp_limb_t* mp_ptr

Definition at line 64 of file mini-gmp.h.

◆ mp_size_t

typedef long mp_size_t

Definition at line 61 of file mini-gmp.h.

◆ mp_srcptr

typedef const mp_limb_t* mp_srcptr

Definition at line 65 of file mini-gmp.h.

◆ mpz_ptr

Definition at line 79 of file mini-gmp.h.

◆ mpz_srcptr

typedef const __mpz_struct* mpz_srcptr

Definition at line 80 of file mini-gmp.h.

◆ mpz_t

typedef __mpz_struct mpz_t[1]

Definition at line 77 of file mini-gmp.h.

Function Documentation

◆ mp_get_memory_functions()

void mp_get_memory_functions ( void *  **)(size_t,
void *  **)(void *, size_t, size_t,
void(**)(void *, size_t)   
)

◆ mp_set_memory_functions()

void mp_set_memory_functions ( void *  *)(size_t,
void *  *)(void *, size_t, size_t,
void(*)(void *, size_t)   
)

◆ mpn_add()

mp_limb_t mpn_add ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  an,
mp_srcptr  bp,
mp_size_t  bn 
)

Definition at line 468 of file mini-gmp.c.

References ap, bp, mpn_add_1(), mpn_add_n(), and rp.

Referenced by mpz_abs_add().

◆ mpn_add_1()

mp_limb_t mpn_add_1 ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n,
mp_limb_t  b 
)

Definition at line 430 of file mini-gmp.c.

References ap, i, and rp.

Referenced by mpn_add(), mpn_set_str_other(), mpz_abs_add_bit(), nettle_ecc_gostdsa_sign(), and nettle_ecc_gostdsa_verify().

◆ mpn_add_n()

mp_limb_t mpn_add_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

◆ mpn_addmul_1()

◆ mpn_cmp()

◆ mpn_com()

void mpn_com ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n 
)

Definition at line 742 of file mini-gmp.c.

References rp, and up.

Referenced by mpn_neg().

◆ mpn_copyd()

void mpn_copyd ( mp_ptr  d,
mp_srcptr  s,
mp_size_t  n 
)

Definition at line 382 of file mini-gmp.c.

Referenced by _nettle_ecc_a_to_j(), mpn_sqrtrem(), and mpz_mul_2exp().

◆ mpn_copyi()

◆ mpn_get_str()

size_t mpn_get_str ( unsigned char *  sp,
int  base,
mp_ptr  up,
mp_size_t  un 
)

◆ mpn_invert_3by2()

mp_limb_t mpn_invert_3by2 ( mp_limb_t  u1,
mp_limb_t  u0 
)

Definition at line 771 of file mini-gmp.c.

References GMP_LIMB_BITS, GMP_LIMB_MAX, GMP_LLIMB_MASK, gmp_umul_ppmm, and u1.

Referenced by mpn_div_qr_2_invert(), and mpn_div_qr_invert().

◆ mpn_lshift()

mp_limb_t mpn_lshift ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
unsigned int  cnt 
)

◆ mpn_mul()

mp_limb_t mpn_mul ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  un,
mp_srcptr  vp,
mp_size_t  vn 
)

Definition at line 608 of file mini-gmp.c.

References GMP_MPN_OVERLAP_P, mpn_addmul_1(), mpn_mul_1(), rp, up, and vp.

Referenced by mpn_mul_n(), mpn_sqr(), and mpz_mul().

◆ mpn_mul_1()

mp_limb_t mpn_mul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

Definition at line 533 of file mini-gmp.c.

References gmp_umul_ppmm, rp, and up.

Referenced by _nettle_ecc_mod_mul_1(), mpn_mul(), and mpn_set_str_other().

◆ mpn_mul_n()

void mpn_mul_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Definition at line 633 of file mini-gmp.c.

References ap, bp, mpn_mul(), and rp.

Referenced by _nettle_ecc_mod_mul(), and _nettle_ecc_mod_mul_canonical().

◆ mpn_neg()

mp_limb_t mpn_neg ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n 
)

Definition at line 749 of file mini-gmp.c.

References mpn_com(), rp, and up.

Referenced by mpz_div_r_2exp().

◆ mpn_perfect_square_p()

int mpn_perfect_square_p ( mp_srcptr  p,
mp_size_t  n 
)

Definition at line 3280 of file mini-gmp.c.

References mpz_roinit_normal_n(), mpz_root(), and NULL.

◆ mpn_popcount()

mp_bitcnt_t mpn_popcount ( mp_srcptr  p,
mp_size_t  n 
)

Definition at line 4023 of file mini-gmp.c.

References gmp_popcount_limb(), and i.

Referenced by mpz_popcount().

◆ mpn_rshift()

mp_limb_t mpn_rshift ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
unsigned int  cnt 
)

Definition at line 675 of file mini-gmp.c.

References GMP_LIMB_BITS, rp, and up.

Referenced by _nettle_ecc_hash(), _nettle_ecc_mod_inv(), mpn_div_qr_preinv(), and mpz_div_q_2exp().

◆ mpn_scan0()

mp_bitcnt_t mpn_scan0 ( mp_srcptr  ptr,
mp_bitcnt_t  bit 
)

Definition at line 732 of file mini-gmp.c.

References GMP_LIMB_BITS, GMP_LIMB_MAX, i, and mpn_common_scan().

◆ mpn_scan1()

mp_bitcnt_t mpn_scan1 ( mp_srcptr  ptr,
mp_bitcnt_t  bit 
)

Definition at line 722 of file mini-gmp.c.

References GMP_LIMB_BITS, GMP_LIMB_MAX, i, and mpn_common_scan().

◆ mpn_set_str()

mp_size_t mpn_set_str ( mp_ptr  rp,
const unsigned char *  sp,
size_t  sn,
int  base 
)

◆ mpn_sqr()

void mpn_sqr ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n 
)

Definition at line 639 of file mini-gmp.c.

References ap, mpn_mul(), and rp.

Referenced by _nettle_ecc_mod_sqr(), and _nettle_ecc_mod_sqr_canonical().

◆ mpn_sqrtrem()

mp_size_t mpn_sqrtrem ( mp_ptr  sp,
mp_ptr  rp,
mp_srcptr  p,
mp_size_t  n 
)

Definition at line 3290 of file mini-gmp.c.

References mpn_copyd(), mpz_clear(), mpz_init(), mpz_roinit_normal_n(), mpz_rootrem(), rp, and sp.

◆ mpn_sub()

mp_limb_t mpn_sub ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  an,
mp_srcptr  bp,
mp_size_t  bn 
)

Definition at line 520 of file mini-gmp.c.

References ap, bp, mpn_sub_1(), mpn_sub_n(), and rp.

Referenced by mpz_abs_sub(), and mpz_powm().

◆ mpn_sub_1()

mp_limb_t mpn_sub_1 ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n,
mp_limb_t  b 
)

Definition at line 481 of file mini-gmp.c.

References ap, i, and rp.

Referenced by mpn_sub(), and mpz_abs_sub_bit().

◆ mpn_sub_n()

◆ mpn_submul_1()

mp_limb_t mpn_submul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

◆ mpn_zero()

◆ mpn_zero_p()

◆ mpz_2fac_ui()

void mpz_2fac_ui ( mpz_t  x,
unsigned long  n 
)

Definition at line 3324 of file mini-gmp.c.

References mpz_mfac_uiui(), and x.

◆ mpz_abs()

void mpz_abs ( mpz_t  r,
const  mpz_t 
)

Definition at line 1912 of file mini-gmp.c.

References GMP_ABS, and mpz_set().

Referenced by mpz_gcd(), mpz_gcdext(), mpz_lcm(), mpz_lcm_ui(), mpz_powm(), and mpz_probab_prime_p().

◆ mpz_add()

◆ mpz_add_ui()

◆ mpz_addmul()

void mpz_addmul ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2150 of file mini-gmp.c.

References mpz_add(), mpz_clear(), mpz_init(), mpz_mul(), and v.

Referenced by ecc_add().

◆ mpz_addmul_ui()

void mpz_addmul_ui ( mpz_t  r,
const  mpz_t,
unsigned long int  v 
)

Definition at line 2130 of file mini-gmp.c.

References mpz_add(), mpz_clear(), mpz_init_set_ui(), mpz_mul(), and v.

◆ mpz_and()

void mpz_and ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 3787 of file mini-gmp.c.

References GMP_ABS, i, MP_SIZE_T_SWAP, mpn_normalized_size(), MPZ_REALLOC, MPZ_SRCPTR_SWAP, rp, up, v, and vp.

Referenced by output_digits().

◆ mpz_bin_uiui()

void mpz_bin_uiui ( mpz_t  r,
unsigned long  n,
unsigned long  k 
)

Definition at line 3336 of file mini-gmp.c.

References k, mpz_clear(), mpz_divexact(), mpz_fac_ui(), mpz_init(), mpz_mul_ui(), and mpz_set_ui().

◆ mpz_cdiv_q()

void mpz_cdiv_q ( mpz_t  q,
const  mpz_t,
const  mpz_t 
)

Definition at line 2305 of file mini-gmp.c.

References GMP_DIV_CEIL, mpz_div_qr(), and NULL.

◆ mpz_cdiv_q_2exp()

void mpz_cdiv_q_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  cnt 
)

Definition at line 2471 of file mini-gmp.c.

References GMP_DIV_CEIL, and mpz_div_q_2exp().

◆ mpz_cdiv_q_ui()

unsigned long mpz_cdiv_q_ui ( mpz_t  q,
const  mpz_t,
unsigned long  d 
)

Definition at line 2575 of file mini-gmp.c.

References GMP_DIV_CEIL, mpz_div_qr_ui(), and NULL.

◆ mpz_cdiv_qr()

void mpz_cdiv_qr ( mpz_t  q,
mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2287 of file mini-gmp.c.

References GMP_DIV_CEIL, and mpz_div_qr().

◆ mpz_cdiv_qr_ui()

unsigned long mpz_cdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2557 of file mini-gmp.c.

References GMP_DIV_CEIL, and mpz_div_qr_ui().

◆ mpz_cdiv_r()

void mpz_cdiv_r ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2323 of file mini-gmp.c.

References GMP_DIV_CEIL, mpz_div_qr(), and NULL.

◆ mpz_cdiv_r_2exp()

void mpz_cdiv_r_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  cnt 
)

Definition at line 2489 of file mini-gmp.c.

References GMP_DIV_CEIL, and mpz_div_r_2exp().

◆ mpz_cdiv_r_ui()

unsigned long mpz_cdiv_r_ui ( mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2593 of file mini-gmp.c.

References GMP_DIV_CEIL, mpz_div_qr_ui(), and NULL.

◆ mpz_cdiv_ui()

unsigned long mpz_cdiv_ui ( const  mpz_t,
unsigned long  d 
)

Definition at line 2609 of file mini-gmp.c.

References GMP_DIV_CEIL, mpz_div_qr_ui(), and NULL.

◆ mpz_clear()

void mpz_clear ( mpz_t  r)

Definition at line 1435 of file mini-gmp.c.

References gmp_free.

Referenced by _nettle_generate_pocklington_prime(), _nettle_rsa_blind(), _nettle_rsa_verify(), convert_dsa_private_key(), convert_public_key(), ecc_add(), ecc_clear(), ecc_curve_check(), ecc_curve_clear(), ecc_dup(), ecc_mul_pippenger(), gmp_lucas_mod(), miller_rabin_pocklington(), mpn_sqrtrem(), mpz_add_ui(), mpz_addmul(), mpz_addmul_ui(), mpz_bin_uiui(), mpz_congruent_p(), mpz_div_qr(), mpz_div_qr_ui(), mpz_gcd(), mpz_gcd_ui(), mpz_gcdext(), mpz_invert(), mpz_lcm(), mpz_mul(), mpz_mul_ui(), mpz_pow_ui(), mpz_powm(), mpz_powm_ui(), mpz_probab_prime_p(), mpz_root(), mpz_rootrem(), mpz_submul(), mpz_submul_ui(), mpz_ui_pow_ui(), nettle_dsa_generate_keypair(), nettle_dsa_generate_params(), nettle_dsa_params_clear(), nettle_dsa_private_key_clear(), nettle_dsa_public_key_clear(), nettle_dsa_sign(), nettle_dsa_signature_clear(), nettle_dsa_verify(), nettle_ecc_point_set(), nettle_mpz_get_str_256(), nettle_mpz_set_str_256_s(), nettle_mpz_sizeinbase_256_s(), nettle_pgp_put_rsa_sha1_signature(), nettle_random_prime(), nettle_rsa_decrypt(), nettle_rsa_generate_keypair(), nettle_rsa_md5_sign_digest_tr(), nettle_rsa_md5_sign_tr(), nettle_rsa_md5_verify(), nettle_rsa_md5_verify_digest(), nettle_rsa_pkcs1_sign_tr(), nettle_rsa_pkcs1_verify(), nettle_rsa_private_key_clear(), nettle_rsa_private_key_prepare(), nettle_rsa_pss_sha256_sign_digest_tr(), nettle_rsa_pss_sha256_verify_digest(), nettle_rsa_pss_sha384_sign_digest_tr(), nettle_rsa_pss_sha384_verify_digest(), nettle_rsa_pss_sha512_sign_digest_tr(), nettle_rsa_pss_sha512_verify_digest(), nettle_rsa_public_key_clear(), nettle_rsa_sha1_sign_digest_tr(), nettle_rsa_sha1_sign_tr(), nettle_rsa_sha1_verify(), nettle_rsa_sha1_verify_digest(), nettle_rsa_sha256_sign_digest_tr(), nettle_rsa_sha256_sign_tr(), nettle_rsa_sha256_verify(), nettle_rsa_sha256_verify_digest(), nettle_rsa_sha512_sign_digest_tr(), nettle_rsa_sha512_sign_tr(), nettle_rsa_sha512_verify(), nettle_rsa_sha512_verify_digest(), output_curve(), output_digits(), output_modulo(), and output_point().

◆ mpz_clrbit()

void mpz_clrbit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

Definition at line 3759 of file mini-gmp.c.

References mpz_abs_add_bit(), mpz_abs_sub_bit(), and mpz_tstbit().

Referenced by output_curve().

◆ mpz_cmp()

◆ mpz_cmp_d()

int mpz_cmp_d ( const  mpz_t,
double  d 
)

Definition at line 1826 of file mini-gmp.c.

References mpz_cmpabs_d(), and x.

◆ mpz_cmp_si()

int mpz_cmp_si ( const  mpz_t,
long  v 
)

Definition at line 1853 of file mini-gmp.c.

References GMP_NEG_CAST, mpz_cmp_ui(), mpz_cmpabs_ui(), and v.

Referenced by mpz_fits_sint_p(), mpz_fits_slong_p(), and mpz_fits_sshort_p().

◆ mpz_cmp_ui()

int mpz_cmp_ui ( const  mpz_t,
unsigned long  v 
)

◆ mpz_cmpabs()

int mpz_cmpabs ( const  mpz_t,
const  mpz_t 
)

Definition at line 1905 of file mini-gmp.c.

References GMP_ABS, mpn_cmp4(), and v.

Referenced by mpz_gcdext(), and mpz_rootrem().

◆ mpz_cmpabs_d()

int mpz_cmpabs_d ( const  mpz_t,
double  d 
)

Definition at line 1785 of file mini-gmp.c.

References B, GMP_ABS, GMP_LIMB_HIGHBIT, i, and x.

Referenced by mpz_cmp_d().

◆ mpz_cmpabs_ui()

int mpz_cmpabs_ui ( const  mpz_t,
unsigned long  v 
)

◆ mpz_com()

void mpz_com ( mpz_t  r,
const  mpz_t 
)

Definition at line 3780 of file mini-gmp.c.

References mpz_add_ui(), and mpz_neg().

Referenced by nettle_mpz_get_str_256(), and nettle_mpz_sizeinbase_256_s().

◆ mpz_combit()

void mpz_combit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

Definition at line 3771 of file mini-gmp.c.

References mpz_abs_add_bit(), mpz_abs_sub_bit(), and mpz_tstbit().

◆ mpz_congruent_p()

int mpz_congruent_p ( const  mpz_t,
const  mpz_t,
const  mpz_t 
)

Definition at line 2519 of file mini-gmp.c.

References mpz_clear(), mpz_cmp(), mpz_divisible_p(), mpz_init(), mpz_sgn(), and mpz_sub().

Referenced by nettle_ecc_point_set().

◆ mpz_divexact()

void mpz_divexact ( mpz_t  q,
const  mpz_t,
const  mpz_t 
)

Definition at line 2507 of file mini-gmp.c.

References gmp_assert_nocarry, GMP_DIV_TRUNC, mpz_div_qr(), and NULL.

Referenced by mpz_bin_uiui(), mpz_gcdext(), and mpz_lcm().

◆ mpz_divexact_ui()

void mpz_divexact_ui ( mpz_t  q,
const  mpz_t,
unsigned long  d 
)

Definition at line 2633 of file mini-gmp.c.

References gmp_assert_nocarry, GMP_DIV_TRUNC, mpz_div_qr_ui(), and NULL.

◆ mpz_divisible_p()

int mpz_divisible_p ( const  mpz_t,
const  mpz_t 
)

Definition at line 2513 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr(), and NULL.

Referenced by mpz_congruent_p().

◆ mpz_divisible_ui_p()

int mpz_divisible_ui_p ( const  mpz_t,
unsigned long  d 
)

Definition at line 2639 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr_ui(), and NULL.

◆ mpz_export()

void* mpz_export ( void *  r,
size_t *  countp,
int  order,
size_t  size,
int  endian,
size_t  nails,
const  mpz_t 
)

Definition at line 4491 of file mini-gmp.c.

References GMP_ABS, gmp_detect_endian(), gmp_die(), GMP_LIMB_BITS, gmp_xalloc, i, j, and k.

◆ mpz_fac_ui()

void mpz_fac_ui ( mpz_t  x,
unsigned long  n 
)

Definition at line 3330 of file mini-gmp.c.

References mpz_mfac_uiui(), and x.

Referenced by mpz_bin_uiui().

◆ mpz_fdiv_q()

void mpz_fdiv_q ( mpz_t  q,
const  mpz_t,
const  mpz_t 
)

Definition at line 2311 of file mini-gmp.c.

References GMP_DIV_FLOOR, mpz_div_qr(), and NULL.

Referenced by _nettle_generate_pocklington_prime().

◆ mpz_fdiv_q_2exp()

void mpz_fdiv_q_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  cnt 
)

Definition at line 2477 of file mini-gmp.c.

References GMP_DIV_FLOOR, and mpz_div_q_2exp().

Referenced by miller_rabin_pocklington(), and output_curve().

◆ mpz_fdiv_q_ui()

unsigned long mpz_fdiv_q_ui ( mpz_t  q,
const  mpz_t,
unsigned long  d 
)

Definition at line 2581 of file mini-gmp.c.

References GMP_DIV_FLOOR, mpz_div_qr_ui(), and NULL.

◆ mpz_fdiv_qr()

void mpz_fdiv_qr ( mpz_t  q,
mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2293 of file mini-gmp.c.

References GMP_DIV_FLOOR, and mpz_div_qr().

◆ mpz_fdiv_qr_ui()

unsigned long mpz_fdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2563 of file mini-gmp.c.

References GMP_DIV_FLOOR, and mpz_div_qr_ui().

◆ mpz_fdiv_r()

void mpz_fdiv_r ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

◆ mpz_fdiv_r_2exp()

void mpz_fdiv_r_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  cnt 
)

Definition at line 2495 of file mini-gmp.c.

References GMP_DIV_FLOOR, and mpz_div_r_2exp().

Referenced by nettle_mpz_random_size().

◆ mpz_fdiv_r_ui()

unsigned long mpz_fdiv_r_ui ( mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2598 of file mini-gmp.c.

References GMP_DIV_FLOOR, mpz_div_qr_ui(), and NULL.

◆ mpz_fdiv_ui()

unsigned long mpz_fdiv_ui ( const  mpz_t,
unsigned long  d 
)

Definition at line 2615 of file mini-gmp.c.

References GMP_DIV_FLOOR, mpz_div_qr_ui(), and NULL.

Referenced by output_curve().

◆ mpz_fits_sint_p()

int mpz_fits_sint_p ( const  mpz_t)

Definition at line 1568 of file mini-gmp.c.

References mpz_cmp_si().

◆ mpz_fits_slong_p()

int mpz_fits_slong_p ( const  mpz_t)

Definition at line 1542 of file mini-gmp.c.

References mpz_cmp_si().

◆ mpz_fits_sshort_p()

int mpz_fits_sshort_p ( const  mpz_t)

Definition at line 1580 of file mini-gmp.c.

References mpz_cmp_si().

◆ mpz_fits_uint_p()

int mpz_fits_uint_p ( const  mpz_t)

Definition at line 1574 of file mini-gmp.c.

References mpz_cmpabs_ui().

◆ mpz_fits_ulong_p()

int mpz_fits_ulong_p ( const  mpz_t)

Definition at line 1560 of file mini-gmp.c.

References mpn_absfits_ulong_p().

◆ mpz_fits_ushort_p()

int mpz_fits_ushort_p ( const  mpz_t)

Definition at line 1586 of file mini-gmp.c.

References mpz_cmpabs_ui().

◆ mpz_gcd()

◆ mpz_gcd_ui()

unsigned long mpz_gcd_ui ( mpz_t  g,
const  mpz_t,
unsigned long  v 
)

Definition at line 2690 of file mini-gmp.c.

References g(), mpz_clear(), mpz_gcd(), mpz_get_ui(), mpz_init_set_ui(), mpz_swap(), and v.

Referenced by mpz_lcm_ui(), and mpz_probab_prime_p().

◆ mpz_gcdext()

◆ mpz_get_d()

double mpz_get_d ( const  mpz_t)

Definition at line 1747 of file mini-gmp.c.

References B, GMP_ABS, gmp_clz, GMP_DBL_MANT_BITS, GMP_LIMB_BITS, GMP_LIMB_HIGHBIT, GMP_LIMB_MAX, and x.

◆ mpz_get_si()

long int mpz_get_si ( const  mpz_t)

Definition at line 1592 of file mini-gmp.c.

References mpz_get_ui().

◆ mpz_get_str()

char* mpz_get_str ( char *  sp,
int  base,
const  mpz_t 
)

◆ mpz_get_ui()

unsigned long int mpz_get_ui ( const  mpz_t)

Definition at line 1605 of file mini-gmp.c.

References GMP_ABS, GMP_LIMB_BITS, GMP_MIN, and GMP_ULONG_BITS.

Referenced by mpz_cmpabs_ui(), mpz_div_qr_ui(), mpz_gcd_ui(), and mpz_get_si().

◆ mpz_getlimbn()

mp_limb_t mpz_getlimbn ( const  mpz_t,
mp_size_t  n 
)

Definition at line 1628 of file mini-gmp.c.

References GMP_ABS.

Referenced by nettle_mpz_to_octets().

◆ mpz_hamdist()

mp_bitcnt_t mpz_hamdist ( const  mpz_t,
const  mpz_t 
)

Definition at line 4048 of file mini-gmp.c.

References gmp_popcount_limb(), i, MPN_SRCPTR_SWAP, up, v, and vp.

◆ mpz_import()

void mpz_import ( mpz_t  r,
size_t  count,
int  order,
size_t  size,
int  endian,
size_t  nails,
const void *  src 
)

Definition at line 4423 of file mini-gmp.c.

References gmp_detect_endian(), gmp_die(), i, j, mpn_normalized_size(), MPZ_REALLOC, and rp.

◆ mpz_init()

void mpz_init ( mpz_t  r)

Definition at line 1410 of file mini-gmp.c.

References GMP_LIMB_MAX.

Referenced by _nettle_generate_pocklington_prime(), _nettle_rsa_blind(), _nettle_rsa_verify(), convert_dsa_private_key(), convert_public_key(), ecc_add(), ecc_curve_check(), ecc_dup(), ecc_init(), ecc_mul_pippenger(), miller_rabin_pocklington(), mpn_sqrtrem(), mpz_addmul(), mpz_bin_uiui(), mpz_congruent_p(), mpz_div_qr_ui(), mpz_gcd(), mpz_gcdext(), mpz_init_set(), mpz_init_set_d(), mpz_init_set_si(), mpz_init_set_str(), mpz_init_set_ui(), mpz_invert(), mpz_lcm(), mpz_powm(), mpz_probab_prime_p(), mpz_root(), mpz_rootrem(), mpz_submul(), nettle_dsa_generate_params(), nettle_dsa_params_init(), nettle_dsa_private_key_init(), nettle_dsa_public_key_init(), nettle_dsa_sign(), nettle_dsa_signature_init(), nettle_dsa_verify(), nettle_ecc_point_set(), nettle_mpz_get_str_256(), nettle_mpz_init_set_str_256_s(), nettle_mpz_init_set_str_256_u(), nettle_mpz_sizeinbase_256_s(), nettle_pgp_put_rsa_sha1_signature(), nettle_random_prime(), nettle_rsa_decrypt(), nettle_rsa_generate_keypair(), nettle_rsa_md5_sign_digest_tr(), nettle_rsa_md5_sign_tr(), nettle_rsa_md5_verify(), nettle_rsa_md5_verify_digest(), nettle_rsa_pkcs1_sign_tr(), nettle_rsa_pkcs1_verify(), nettle_rsa_private_key_init(), nettle_rsa_private_key_prepare(), nettle_rsa_pss_sha256_sign_digest_tr(), nettle_rsa_pss_sha256_verify_digest(), nettle_rsa_pss_sha384_sign_digest_tr(), nettle_rsa_pss_sha384_verify_digest(), nettle_rsa_pss_sha512_sign_digest_tr(), nettle_rsa_pss_sha512_verify_digest(), nettle_rsa_public_key_init(), nettle_rsa_sha1_sign_digest_tr(), nettle_rsa_sha1_sign_tr(), nettle_rsa_sha1_verify(), nettle_rsa_sha1_verify_digest(), nettle_rsa_sha256_sign_digest_tr(), nettle_rsa_sha256_sign_tr(), nettle_rsa_sha256_verify(), nettle_rsa_sha256_verify_digest(), nettle_rsa_sha512_sign_digest_tr(), nettle_rsa_sha512_sign_tr(), nettle_rsa_sha512_verify(), nettle_rsa_sha512_verify_digest(), output_curve(), output_digits(), output_modulo(), and output_point().

◆ mpz_init2()

void mpz_init2 ( mpz_t  r,
mp_bitcnt_t  bits 
)

Definition at line 1422 of file mini-gmp.c.

References GMP_LIMB_BITS, and gmp_xalloc_limbs().

Referenced by mpz_div_qr(), and mpz_mul().

◆ mpz_init_set()

void mpz_init_set ( mpz_t  r,
const  mpz_t 
)

Definition at line 1535 of file mini-gmp.c.

References mpz_init(), mpz_set(), and x.

Referenced by mpz_div_qr(), nettle_dsa_generate_keypair(), nettle_dsa_sign(), and output_digits().

◆ mpz_init_set_d()

void mpz_init_set_d ( mpz_t  r,
double  x 
)

Definition at line 1740 of file mini-gmp.c.

References mpz_init(), mpz_set_d(), and x.

◆ mpz_init_set_si()

void mpz_init_set_si ( mpz_t  r,
signed long int  x 
)

Definition at line 1521 of file mini-gmp.c.

References mpz_init(), mpz_set_si(), and x.

◆ mpz_init_set_str()

int mpz_init_set_str ( mpz_t  r,
const char *  sp,
int  base 
)

Definition at line 4393 of file mini-gmp.c.

References mpz_init(), mpz_set_str(), and sp.

Referenced by ecc_curve_init_str().

◆ mpz_init_set_ui()

◆ mpz_invert()

int mpz_invert ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

◆ mpz_ior()

void mpz_ior ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 3859 of file mini-gmp.c.

References GMP_ABS, i, MP_SIZE_T_SWAP, mpn_normalized_size(), MPZ_REALLOC, mpz_set(), MPZ_SRCPTR_SWAP, rp, up, v, and vp.

◆ mpz_lcm()

void mpz_lcm ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2966 of file mini-gmp.c.

References g(), mpz_abs(), mpz_clear(), mpz_divexact(), mpz_gcd(), mpz_init(), mpz_mul(), and v.

◆ mpz_lcm_ui()

void mpz_lcm_ui ( mpz_t  r,
const  mpz_t,
unsigned long  v 
)

Definition at line 2987 of file mini-gmp.c.

References mpz_abs(), mpz_gcd_ui(), mpz_mul_ui(), NULL, and v.

◆ mpz_limbs_finish()

void mpz_limbs_finish ( mpz_t  x,
mp_size_t  xs 
)

◆ mpz_limbs_modify()

mp_ptr mpz_limbs_modify ( mpz_t  x,
mp_size_t  n 
)

Definition at line 1649 of file mini-gmp.c.

References MPZ_REALLOC, and x.

Referenced by _nettle_mpz_limbs_read_n(), and mpz_limbs_write().

◆ mpz_limbs_read()

◆ mpz_limbs_write()

mp_ptr mpz_limbs_write ( mpz_t  x,
mp_size_t  n 
)

◆ mpz_mfac_uiui()

void mpz_mfac_uiui ( mpz_t  x,
unsigned long  n,
unsigned long  m 
)

Definition at line 3315 of file mini-gmp.c.

References mpz_mul_ui(), mpz_set_ui(), and x.

Referenced by mpz_2fac_ui(), and mpz_fac_ui().

◆ mpz_mod()

void mpz_mod ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

◆ mpz_mod_ui()

unsigned long mpz_mod_ui ( mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2627 of file mini-gmp.c.

References GMP_DIV_FLOOR, mpz_div_qr_ui(), and NULL.

◆ mpz_mul()

◆ mpz_mul_2exp()

void mpz_mul_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  bits 
)

◆ mpz_mul_si()

void mpz_mul_si ( mpz_t  r,
const  mpz_t,
long int  v 
)

Definition at line 2036 of file mini-gmp.c.

References GMP_NEG_CAST, mpz_mul_ui(), mpz_neg(), and v.

Referenced by gmp_lucas_mod().

◆ mpz_mul_ui()

void mpz_mul_ui ( mpz_t  r,
const  mpz_t,
unsigned long int  v 
)

◆ mpz_neg()

void mpz_neg ( mpz_t  r,
const  mpz_t 
)

◆ mpz_perfect_square_p()

int mpz_perfect_square_p ( const  mpz_t)

Definition at line 3271 of file mini-gmp.c.

References mpz_root(), and NULL.

Referenced by _nettle_generate_pocklington_prime().

◆ mpz_popcount()

mp_bitcnt_t mpz_popcount ( const  mpz_t)

Definition at line 4035 of file mini-gmp.c.

References mpn_popcount().

◆ mpz_pow_ui()

void mpz_pow_ui ( mpz_t  r,
const  mpz_t,
unsigned long  e 
)

Definition at line 3037 of file mini-gmp.c.

References GMP_ULONG_HIGHBIT, mpz_clear(), mpz_init_set_ui(), mpz_mul(), and mpz_swap().

Referenced by mpz_rootrem(), and mpz_ui_pow_ui().

◆ mpz_powm()

◆ mpz_powm_ui()

void mpz_powm_ui ( mpz_t  r,
const  mpz_t,
unsigned long  elimb,
const  mpz_t 
)

Definition at line 3173 of file mini-gmp.c.

References mpz_clear(), mpz_init_set_ui(), and mpz_powm().

Referenced by gmp_millerrabin(), and miller_rabin_pocklington().

◆ mpz_probab_prime_p()

◆ mpz_realloc2()

void mpz_realloc2 ( mpz_t  x,
mp_bitcnt_t  n 
)

Definition at line 1637 of file mini-gmp.c.

References GMP_LIMB_BITS, mpz_realloc(), and x.

◆ mpz_roinit_n()

mpz_srcptr mpz_roinit_n ( mpz_t  x,
mp_srcptr  xp,
mp_size_t  xs 
)

Definition at line 1679 of file mini-gmp.c.

References mpz_limbs_finish(), mpz_roinit_normal_n(), x, and xp.

Referenced by nettle_ecc_point_set().

◆ mpz_root()

int mpz_root ( mpz_t  x,
const  mpz_t,
unsigned long  z 
)

Definition at line 3244 of file mini-gmp.c.

References mpz_clear(), mpz_init(), mpz_rootrem(), and x.

Referenced by gmp_stronglucas(), mpn_perfect_square_p(), and mpz_perfect_square_p().

◆ mpz_rootrem()

◆ mpz_scan0()

mp_bitcnt_t mpz_scan0 ( const  mpz_t,
mp_bitcnt_t  starting_bit 
)

Definition at line 4135 of file mini-gmp.c.

References GMP_ABS, GMP_LIMB_BITS, GMP_LIMB_MAX, i, mpn_common_scan(), mpn_zero_p(), and up.

Referenced by output_curve().

◆ mpz_scan1()

mp_bitcnt_t mpz_scan1 ( const  mpz_t,
mp_bitcnt_t  starting_bit 
)

◆ mpz_set()

void mpz_set ( mpz_t  r,
const  mpz_t 
)

◆ mpz_set_d()

void mpz_set_d ( mpz_t  r,
double  x 
)

Definition at line 1689 of file mini-gmp.c.

References B, GMP_LIMB_HIGHBIT, i, MPZ_REALLOC, rp, and x.

Referenced by mpz_init_set_d().

◆ mpz_set_si()

void mpz_set_si ( mpz_t  r,
signed long int  x 
)

◆ mpz_set_str()

int mpz_set_str ( mpz_t  r,
const char *  sp,
int  base 
)

◆ mpz_set_ui()

◆ mpz_setbit()

void mpz_setbit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

◆ mpz_sgn()

◆ mpz_size()

◆ mpz_sizeinbase()

◆ mpz_sqrt()

void mpz_sqrt ( mpz_t  s,
const  mpz_t 
)

Definition at line 3265 of file mini-gmp.c.

References mpz_rootrem(), and NULL.

◆ mpz_sqrtrem()

void mpz_sqrtrem ( mpz_t  s,
mpz_t  r,
const  mpz_t 
)

Definition at line 3259 of file mini-gmp.c.

References mpz_rootrem().

◆ mpz_sub()

◆ mpz_sub_ui()

◆ mpz_submul()

void mpz_submul ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2160 of file mini-gmp.c.

References mpz_clear(), mpz_init(), mpz_mul(), mpz_sub(), and v.

Referenced by ecc_add(), and nettle_ecc_point_set().

◆ mpz_submul_ui()

void mpz_submul_ui ( mpz_t  r,
const  mpz_t,
unsigned long int  v 
)

◆ mpz_swap()

◆ mpz_tdiv_q()

void mpz_tdiv_q ( mpz_t  q,
const  mpz_t,
const  mpz_t 
)

Definition at line 2317 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr(), and NULL.

Referenced by mpz_rootrem().

◆ mpz_tdiv_q_2exp()

void mpz_tdiv_q_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  cnt 
)

◆ mpz_tdiv_q_ui()

unsigned long mpz_tdiv_q_ui ( mpz_t  q,
const  mpz_t,
unsigned long  d 
)

Definition at line 2587 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr_ui(), and NULL.

Referenced by mpz_rootrem().

◆ mpz_tdiv_qr()

void mpz_tdiv_qr ( mpz_t  q,
mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2299 of file mini-gmp.c.

References GMP_DIV_TRUNC, and mpz_div_qr().

Referenced by _nettle_generate_pocklington_prime(), and mpz_gcdext().

◆ mpz_tdiv_qr_ui()

unsigned long mpz_tdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2569 of file mini-gmp.c.

References GMP_DIV_TRUNC, and mpz_div_qr_ui().

◆ mpz_tdiv_r()

void mpz_tdiv_r ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 2335 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr(), and NULL.

Referenced by gmp_lucas_mod(), gmp_lucas_step_k_2k(), and mpz_gcd().

◆ mpz_tdiv_r_2exp()

void mpz_tdiv_r_2exp ( mpz_t  r,
const  mpz_t,
mp_bitcnt_t  cnt 
)

Definition at line 2501 of file mini-gmp.c.

References GMP_DIV_TRUNC, and mpz_div_r_2exp().

◆ mpz_tdiv_r_ui()

unsigned long mpz_tdiv_r_ui ( mpz_t  r,
const  mpz_t,
unsigned long  d 
)

Definition at line 2603 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr_ui(), and NULL.

◆ mpz_tdiv_ui()

unsigned long mpz_tdiv_ui ( const  mpz_t,
unsigned long  d 
)

Definition at line 2621 of file mini-gmp.c.

References GMP_DIV_TRUNC, mpz_div_qr_ui(), and NULL.

Referenced by gmp_stronglucas(), and mpz_gcd().

◆ mpz_tstbit()

int mpz_tstbit ( const  mpz_t,
mp_bitcnt_t  bit_index 
)

◆ mpz_ui_pow_ui()

void mpz_ui_pow_ui ( mpz_t  r,
unsigned long  blimb,
unsigned long  e 
)

Definition at line 3058 of file mini-gmp.c.

References mpz_clear(), mpz_init_set_ui(), and mpz_pow_ui().

◆ mpz_ui_sub()

void mpz_ui_sub ( mpz_t  r,
unsigned long  a,
const  mpz_t 
)

Definition at line 1954 of file mini-gmp.c.

References mpz_add_ui(), and mpz_neg().

Referenced by ecc_add(), and mpz_sub_ui().

◆ mpz_xor()

void mpz_xor ( mpz_t  r,
const  mpz_t,
const  mpz_t 
)

Definition at line 3932 of file mini-gmp.c.

References GMP_ABS, i, MP_SIZE_T_SWAP, mpn_normalized_size(), MPZ_REALLOC, mpz_set(), MPZ_SRCPTR_SWAP, rp, up, v, and vp.

Variable Documentation

◆ mp_bits_per_limb

const int mp_bits_per_limb
extern

Definition at line 274 of file mini-gmp.c.