Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
2b186cb8
Commit
2b186cb8
authored
May 09, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated mini-gmp files, from gmp-6.0.0.
parent
b7edcda8
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
623 additions
and
327 deletions
+623
-327
ChangeLog
ChangeLog
+3
-0
mini-gmp.c
mini-gmp.c
+574
-319
mini-gmp.h
mini-gmp.h
+46
-8
No files found.
ChangeLog
View file @
2b186cb8
2014-05-09 Niels Möller <nisse@lysator.liu.se>
* mini-gmp.c: Updated, use version from gmp-6.0.0.
* mini-gmp.h: Likewise.
* testsuite/Makefile.in (all): Drop dependency on $(TARGETS), to
delay building of test programs until make check.
...
...
mini-gmp.c
View file @
2b186cb8
This diff is collapsed.
Click to expand it.
mini-gmp.h
View file @
2b186cb8
/* mini-gmp, a minimalistic implementation of a GNU GMP subset.
Copyright 2011
,
201
2, 2013
Free Software Foundation, Inc.
Copyright 2011
-
201
4
Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser
General Public
License
for more details.
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
/* About mini-gmp: This is a minimal implementation of a subset of the
GMP interface. It is intended for inclusion into applications which
...
...
@@ -64,8 +75,11 @@ typedef __mpz_struct mpz_t[1];
typedef
__mpz_struct
*
mpz_ptr
;
typedef
const
__mpz_struct
*
mpz_srcptr
;
extern
const
int
mp_bits_per_limb
;
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
);
...
...
@@ -84,10 +98,17 @@ 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
);
mp_bitcnt_t
mpn_popcount
(
mp_srcptr
,
mp_size_t
);
mp_limb_t
mpn_invert_3by2
(
mp_limb_t
,
mp_limb_t
);
#define mpn_invert_limb(x) mpn_invert_3by2 ((x), 0)
...
...
@@ -124,6 +145,10 @@ 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
);
...
...
@@ -147,6 +172,7 @@ 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
);
...
...
@@ -176,6 +202,7 @@ 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
);
...
...
@@ -188,6 +215,8 @@ int mpz_root (mpz_t, const mpz_t, unsigned long);
void
mpz_fac_ui
(
mpz_t
,
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
);
...
...
@@ -211,6 +240,15 @@ 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
);
#define MPZ_ROINIT_N(xp, xs) {{0, (xs),(xp) }}
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment