Ciao,
Il Dom, 19 Febbraio 2017 9:21 am, Niels Möller ha scritto:
> But shifting, as you suggest, might be simpler, using
>
> 2 B^623 = 20023 (mod p)
A possible generalization follows:
#include
#include
#include
#include
#define GSIZE (19937 / GMP_NUMB_BITS)
#define GSHIFT (19937 %
Ciao,
Il Dom, 19 Marzo 2017 6:41 pm, David Hadaller ha scritto:
> 1 of 58 tests failed
With test? You are not giving any information...
> make[4]: Leaving directory '/home/david/Downloads/gmp-4.3.2/tests/mpz'
... anyway, the last release is GMP-6.1.2, please try that.
Have a nice GMP
Ciao,
Il Ven, 3 Marzo 2017 3:10 am, Pedro Gimeno ha scritto:
> Marco Bodrato wrote, On 2017-03-02 21:37:
> Just one comment. You're switching algorithms for the top half. Wouldn't
> it be easier to change the key (the k[] array) instead? That might also
> produce less correlation
Ciao,
Il 2017-03-08 02:17 shen lixing ha scritto:
I installed MinGW, then 'mingw-get install mingw32-gmp' , got the gmp
5.1.2 properly.
The last release of the library is 6.1.2 .
unsigned long long c = 10307e7 - 1; // change c,start point
mpz_set_ui(b,c);
Ciao,
Il Mer, 26 Aprile 2017 12:25 pm, Nicolas Hake ha scritto:
> Torbjörn Granlund wrote:
>> Where do we (unconditionally) rely on variable-length arrays?
>
> mpn/generic/sqrlo_basecase.c line 153, where SQRLO_BASECASE_ALLOC is a
> non-constant expression by ultimately referencing
Ciao,
Il Sab, 26 Maggio 2018 11:01 pm, Niels Möller ha scritto:
> "Marco Bodrato" <bodr...@mail.dm.unipi.it> writes:
> shift, that is interpreted as the odd value 2^32+1. This number has the
> factorization 641 * 6700417, and if v happens to be a multiple of one of
Ciao,
Il Mer, 30 Maggio 2018 10:20 am, Niels Möller ha scritto:
> "Marco Bodrato" writes:
> Thinking about micro optimizations... Consider
>> count_trailing_zeros (c, ulimb);
>> ulimb = (ulimb >> 1) >> c;
> vs
>> count_tra
Ciao,
Il Lun, 28 Maggio 2018 10:00 pm, Niels Möller ha scritto:
> I'd suggest the below (complete file, I think that's more readable
The code is clean.
You removed all gotos...
> The last part of the function requires vlimb odd, but tolerates
> arbitrary u, including 0.
... the effect is that
Ciao,
Il Sab, 26 Maggio 2018 11:01 pm, Niels Möller ha scritto:
> Is it possible to construct some examples with v a multiple of 641, and
> input U such that ulimb = 2^31 after reduction?
It was hard, but we got it:
https://gmplib.org/repo/gmp/rev/1f8a8fefb5c2
The bug is triggered not only for
Ciao,
Il Mer, 27 Dicembre 2017 6:10 pm, Marc Glisse ha scritto:
> On Wed, 27 Dec 2017, Niels Möller wrote:
>> And below, a patch to delete all mention of COUNT_LEADING_ZEROS_0,
>> except for tune/many.pl, which I'm not familiar with. What do you think?
> It seems a bit sad to drop this
Ciao,
Il Lun, 31 Dicembre 2018 7:03 pm, Jeffrey Walton ha scritto:
[...skipping opinions...]
> Here's a small example of triggering an assert using the Nettle
> library.
This absolutely is NOT a "small example", it requires to build two entire
libraries!
Anyway we analysed it, see below.
> ARM
Ciao,
I'm not sending to oss-security... They does not seem to be interested.
Il Gio, 3 Gennaio 2019 9:42 pm, Jeffrey Walton ha scritto:
> On Thu, Jan 3, 2019 at 2:55 PM Marco Bodrato
> wrote:
>> This absolutely is NOT a "small example", it requires to build two
>&g
Ciao,
Il Lun, 2 Settembre 2019 11:48 pm, Dennis Clarke ha scritto:
> This one pops up now and again if I go with LLVM/Clang on FreeBSD and
> with really strict CFLAGS. So in a few files I had to drop in a silly
> typedef.
Adding silly lines in the code is not a priority for this project :-D
By
Ciao,
Il Lun, 2 Settembre 2019 11:48 pm, Dennis Clarke ha scritto:
> t-get_str.c +69:30: error: format specifies type 'void *' but the
> argument has type 'const char *' [-Werror,-Wformat-pedantic]
>printf (" want %p\n", want);
>~~ ^~~~
>
Ciao,
Il Ven, 8 Novembre 2019 4:59 pm, Niels Möller ha scritto:
> Hans Åberg writes:
>
>> How about memory allocations? — There is info here, suggesting
>> uninitialized memory access in the test suite:
Our priority is to avoid bugs in the library. So that we usually pay more
attention to the
Ciao,
Il Ven, 6 Dicembre 2019 3:55 pm, Torbjörn Granlund ha scritto:
> ni...@lysator.liu.se (Niels Möller) writes:
>
> > From my understanding this might be a difference in how GCC 7.2.0
> > handles unsigned longs vs GCC 4.8.5.
>
> Can you file a gcc bug? These constants are defined as
>
Ciao,
Il 2020-02-29 11:54 paul zimmermann ha scritto:
it seems that mpz_powm_ui is highly inefficient when BASE^EXP has about
the
same size as MOD, in which case it could first compute BASE^EXP
exactly, then
perform only one reduction:
You are right, mpz_powm_ui does not implement an
Ciao,
Il Ven, 10 Gennaio 2020 5:04 pm, Vincent Lefevre ha scritto:
> On 2020-01-10 16:27:31 +0100, Marco Bodrato wrote:
>> Can you please try with the development version?
> I get the following error:
> gmp_vsnprintf return value wrong
... because there was an error in the p
Ciao,
Il 2020-09-03 19:22 ni...@lysator.liu.se ha scritto:
Mustafa Mohamad writes:
Currently GMP aborts which sends SIGBART and forcibly aborts Julia or
any linked program. With the above patch, GMP will instead throw a
__GMP_ALLOC_OVERFLOW_FUNC
Instead of forcibly aborting
Hi, I
Il 2020-10-14 21:28 t...@gmplib.org ha scritto:
Andreas Buff writes:
Latest snapshot is from may though
There is one made every day.
Look for a filename starting with gmp-6.2.0-202010...
Then please follow up here!
Ĝis,
m
___
gmp-bugs
Ciao,
Il 2020-09-29 16:09 TonyMcC ha scritto:
I think there is a word (a function name?) missing from the
documentation for gmp 6.2.0. In gmp.texi, at line 2541 it reads:
"it's probably best to call to get a starting point and iterate from
there."
Should there be a function name after
Ciao,
Il 2020-09-21 18:16 t...@gmplib.org ha scritto:
overflow. The overflow detection flags some false positives, which is
by design.
But maybe we could avoid the false positive at least for the following
example:
#include
#include "gmp.h"
int main (void)
{
mpz_t z;
mpz_init (z);
Ciao,
Il 2020-09-16 14:35 Vincent Lefevre ha scritto:
In mini-gmp/mini-gmp.h, concerning FILE tests:
/* This long list taken from gmp.h. */
but the list in GMP 6.2.0 and the current repository is not up-to-date.
I re-synced the lists, thanks!
Ĝis,
m
Ciao Luc,
Il Gio, 3 Dicembre 2020 5:03 pm, Luc Sanselme ha scritto:
> I ran make check on termux on my phone and It's OK now.
Great, thank you!
Then, also the new release GMP-6.2.1 should be OK.
Ĝis,
m
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
Il 2020-06-08 21:52 Marc Glisse ha scritto:
[handle *-*-msys exactly the same as *-*-mingw* in configure.ac]
configfsf.guess does mention a triple *-pc-msys, so I guess it makes
sense to handle it (or replace it with something we already handle). I
don't really know in what ways it differs
Ciao,
Il 2020-11-08 00:45 Dennis Clarke ha scritto:
However the tests blow up due to :
convert.c:143:11: error: implicit declaration of function 'strcasecmp'
is invalid in C99
That file will be changed in the next release. Please look if the
applied patch fits your needs.
Ciao Marc,
Il 2020-08-22 19:39 Marc Glisse ha scritto:
Ah, on your OS nl_langinfo is defined inline as a static function in
langinfo.h, so the hack used in the test of redefining the function
cannot work. I guess we are supposed to add some configure check that
nl_langinfo can be redefined...
Ciao Jeremy,
Il 2020-10-02 20:45 Jeremy Drake ha scritto:
Looking at the ld code, it only generated the thunk in the import
library
if it thought the symbol was a function. Checking the output of gcc -S
showed that it added ".def func; .scl 2; .type 32; .endef" to
functions,
and inserting
Ciao Luc,
Il 2020-10-29 08:39 Marc Glisse ha scritto:
I think so, yes. Maybe Luc can confirm if that works?
Could you try if the latest available snapshot is working in your
environment?
You can download it at:
https://gmplib.org/download/snapshot/gmp-6.2/gmp-6.2.0-20201101220635.tar.zst
Ciao Ralph,
Il 2020-05-30 21:12 tsurzin ha scritto:
The PC is running Msys2 under Windows 10 and without change GMP failed
to build.
Can you test if the latest available snapshot is working in your
environment?
You can download it at:
Ciao,
Il 2020-10-29 20:02 Niels Möller ha scritto:
Paul Koning writes:
There is another possibility: GMP might be doing something undefined,
where previous compilers did "what we want" while some recent new ones
do something different.
So you have to forgive GMP developers of not being
Ciao,
Il 2020-11-05 22:27 Niels Möller ha scritto:
I think this is the same result you get with a plain (64-bit) long. The
/ and % operators in C++ produce a quotient rounded towards 0, so (f(1)
- b) / DECKSIZE == 0, and the corresponding remainder is negative.
I'm not that familiar with
Ciao,
Il 2020-12-22 15:55 Guillermo Monguia ha scritto:
In mini-gmp.c function mpz_export, when calling gmp_die("mpz_import:
...") instead of gmp_die("mpz_export: ...")
Corrected, thanks!
https://gmplib.org/repo/gmp/rev/6fed56750f6f
Ĝis,
m
___
Il 2020-09-13 11:38 t...@gmplib.org ha scritto:
Marco Bodrato writes:
With ABI=64 I get:
16777216 ^ 768614336404564651 = 256
With ABI=32 I get:
16777216 ^ 178956971 = 256
Not a signal, nor an abort, simply an incorrect result :-)
That's undesirable.
I thought we cought overflows
Ciao,
Il 2021-02-28 20:41 Paul Dufresne ha scritto:
PASS: t-lucnum_ui
t-lucnum_ui does not segfault, it passes.
/bin/bash : ligne 4 : 116921 Erreur de segmentation (core dumped)
${dir}$tst
FAIL: t-scan
t-scan triggers the error.
make[2] : on quitte le répertoire
«
Ciao,
Il 2021-08-25 05:54 Frank Heckenbach ha scritto:
mpf_get_str seems to round incorrectly sometimes.
In this test program, the digits around 809 are "...244594553...",
so it should round to "...244595", but it outputs "...244594".
Here, your report says that you expected a "rounded"
Ciao,
Il 2021-09-16 23:27 Torbjörn Granlund ha scritto:
Going from byte count to bit count to limb count is non-trivial without
risking overflow, even if the end result will typically be smaller than
the incoming byte count (assuming we're not using gmp/asl.h with tiny
Yes, but, should we
Ciao Simon,
Il 2021-10-20 16:09 Simon Sobisch ha scritto:
Questions:
* Should I care running tuneup at all?
The application does some heavy computations with it in the range
+-9 (mostly multiply and divide [often by 10] and
9 fits in 63 bits, correct?
Ciao,
Il 2021-09-18 10:07 Torbjörn Granlund ha scritto:
I suppose that, in this case, as my fix has problems with nails, this
Your fix also aborts, instead of returning 0.
might be a better patch. An UNLIKELY(...) might have a place here,
though.
I commited the patch, adding UNLIKELY to
Il 2021-11-05 15:12 Torbjörn Granlund ha scritto:
Alex Dupre writes:
tmp-gcd_11.s: Assembler messages:
tmp-gcd_11.s:210: Error: Illegal operands
tmp-gcd_11.s:211: Error: Illegal operands
tmp-gcd_11.s:212: Error: Illegal operands
Above, we saw line numbers...
Ciao,
Il 2022-03-13 00:06 Torbjörn Granlund ha scritto:
There is some sort of sick competition between certain compilers to
have
the most warnings for valid C. I don't think we should play their
game,
Incidantally, arithmetic on unsigned types is well-defined. Unlike
that
of signed
Ciao Paul,
Il 2022-03-09 02:56 Paul Eggert ha scritto:
In libgmp 6.2.1, mini-gmp.c defines a macro without using it, causing
Thanks for spotting this!
Proposed patch attached.
There is also a different possible way to heal the problem: using it :-D
diff -r a44f487c8d20
Ciao,
Il 2022-02-03 08:50 ni...@lysator.liu.se ha scritto:
George Woltman writes:
Minor issue #2 (I should have reported this years ago, sorry):
In gmp.h, these lines:
mpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n)
[...]
*__gmp_rp = (- *__gmp_up) & GMP_NUMB_MASK;
Ciao Paul,
Il 2022-03-18 00:37 Paul Eggert ha scritto:
On 3/17/22 11:32, Marco Bodrato wrote:
- MP_SIZE_T_SWAP (u->_mp_alloc, v->_mp_alloc);
- MP_PTR_SWAP (u->_mp_d, v->_mp_d);
+ MPN_PTR_SWAP (u->_mp_d, u->_mp_alloc, v->_mp_d, v->_mp_alloc);
Thank you, this looks
Ciao,
Il 2022-02-02 23:40 Jack Tearle ha scritto:
I hope the only problem is my doing something wrong.
Maybe.
Of course we can not know what you are doing.
We usually suggest to read the manual page
https://gmplib.org/manual/Reporting-Bugs before reporting problems.
I see the following:
Ciao,
Il 2022-02-03 23:08 Jack Tearle ha scritto:
I deleted /bin/sh, and linked /bin/bash to /bin/sh, and then re-ran the
entire installation in a new directory.
The results are not quite the same. The .libs directory is now
created,
but it is empty and assert.o and the rest of the
Ciao,
Il 2022-02-04 15:57 Jack Tearle ha scritto:
Just to be clear, I purged the directory (rm -r *) and extracted (tar
xvf ../gmp621.tar) the published tar file for each run.
You mean one of the gmp-6.2.1.tar.* files from
https://ftp.gnu.org/gnu/gmp/ or https://gmplib.org/download/gmp/ ,
Ciao,
Il Sab, 22 Gennaio 2022 11:40 pm, Marc Glisse ha scritto:
> mpz_gcd_ui also contains special code for the case
> where op2 (an unsigned long) does not fit in a limb. And that code calls
> mpz_gcd without checking if the first argument is NULL. That probably does
> not affect any platform,
Ciao Marc,
Il 2022-02-08 10:05 Marc Glisse ha scritto:
Makes sense to me. I am just not sure if 3 is the right number and if
we are consistent about it. Shouldn't 2 be enough? Or is it to be safe
You are right. 2 should be enough.
I think that if a not realloc-able mpz is used as a target
Ciao Marc,
Il 2022-01-22 23:40 Marc Glisse ha scritto:
the documentation for mpz_gcd_ui(rop, op1, op2) says "If rop is not
NULL, store the result there." and indeed the main code contains two
tests "if (w != NULL)". However, mpz_gcd_ui also contains special code
for the case where op2 (an
Ciao,
Il Gio, 3 Febbraio 2022 8:50 am, Niels Möller ha scritto:
> George Woltman writes:
>> I get this compiler warning calling mpz_tstbit: warning C4244:
>> 'argument':
>> conversion from 'uint64_t' to 'mp_bitcnt_t', possible loss of data
>> Yes, I'm creating mpz values with more than 4
Ciao,
Il Gio, 3 Febbraio 2022 8:50 am, Niels Möller ha scritto:
> George Woltman writes:
>> I get this compiler warning calling mpz_tstbit: warning C4244:
>> 'argument':
>> conversion from 'uint64_t' to 'mp_bitcnt_t', possible loss of data
>> Yes, I'm creating mpz values with more than 4
Ciao,
I agree with the message by Niels. But I add a comment.
Il 2022-04-14 21:59 Adham Khalile Yousef ha scritto:
My purpose of install gmp is to be able to"# include " in other
C
programs on my machine (i.e., same linux, I even tried to give
If your purpose is simply to use the library,
Ciao,
4 set 2023, 15:19 da vinc...@vinc17.net:
> On 2023-09-04 09:52:23 +0200, marco.bodr...@tutanota.com wrote:
>
>> Should the value ~0 be written as ~0U to be correctly assigned to an
>> unsigned?
>>
>
> IMHO, this would be better as this would make the signedness of
> the types more
Ciao,
3 set 2023, 22:16 da ni...@lysator.liu.se:
> Andrew Teylu writes:
>
> I see no good reason to involve any signed values here, though. Maybe
> the variable neg, and the return value, should be changed to mp_limb_t,
> or at least unsigned int?
>
Yes, unsigned is the best choice, it used
Ciao,
31 ago 2023, 18:06 da vinc...@vinc17.net:
> I don't think that this is sufficient for the test.
> The code Brett mentioned is for MOD_1_1P_METHOD = 2.
>
The code Brett mentioned is mixed, I fear.
Looking at mpn/generic/mod_1_1.c,if MOD_1_1P_METHOD == 1, the value[2] in the
array is
Ciao,
31 ago 2023, 16:30 da ku...@shaw.ca:
> 1) Edit line 248 mpn/generic/mp_limb_t pre[4]; into:
>
~/src/gmp$ hg diff mpn/generic/
diff -r 3ac5afa36be5 mpn/generic/mod_1.c
--- a/mpn/generic/mod_1.c Wed Nov 02 13:48:37 2022 +0100
+++ b/mpn/generic/mod_1.c Thu Aug 31 16:46:35 2023
Ciao,
4 set 2023, 08:02 da ni...@lysator.liu.se:
> As Vincent suggested, it would be good to document somewhere what the
> convention is (values 0 or ~0).
>
Would a comment "It returns 0 or ~0, depending on the sign of the result"
added to all the mpn_toom_eval_ functions suffice?
> And maybe
Ciao,
25 ago 2023, 08:11 da ni...@lysator.liu.se:
> Niels Möller writes:
>
>> It's preferable to use the mpn_powm_sec. When using mpz_t, I see no
>> reasonable to avoid leakage of the normalized size (or number of
>> all-zero limbs at the most significant end).
>>
> One possibly unreasonable
Ciao,
Il Lun, 18 Aprile 2022 9:38 am, Paul Eggert ha scritto:
> mini-gmp.c is different from gmp-impl.h, because it's intended to be
> used by lots of downstream projects which may use compilers that
> gmp-impl.h does not use. This may help to explain why it needs casts
> that gmp-impl.h doesn't
Ciao George,
Il 2022-04-08 18:16 George R Goffe ha scritto:
I'm having a bit of trouble building gmp from the source repository
at:. Here's what make check "tells me". I probably did something wrong
but, for the life of me, can't see it. Here's a snip from the full
build (included).
You
Ciao,
Il 2022-10-26 13:40 ni...@lysator.liu.se ha scritto:
jy l writes:
It seems like in `mpz_nextprime` this line (
https://gmplib.org/repo/gmp/file/tip/mpz/nextprime.c#l204), when `n`
is
very large, it doesn't restrict the value of `odds_in_composite_sieve`
which leads to the `alloca`
Ciao,
Il 2022-08-30 10:25 Vincent Lefevre ha scritto:
or even (mn == 0 check just above this code rules out |m| < 1)
mpz_set_ui (r, mpz_cmpabs_ui (m, 1));
I agree with this solution. Will you commit it?
Concerning this second solution, the GMP manual says:
-- Function: int
Il 2022-09-05 19:04 Marco Bodrato ha scritto:
Il 2022-08-30 10:25 Vincent Lefevre ha scritto:
or even (mn == 0 check just above this code rules out |m| < 1)
mpz_set_ui (r, mpz_cmpabs_ui (m, 1));
I agree with this solution. Will you commit it?
I incorrectly removed the "Niel
Ciao,
Il 2022-09-05 21:23 ni...@lysator.liu.se ha scritto:
Marco Bodrato writes:
I propose to also add a couple of tests to mini-gmp/tests/t-powm.c ,
to keep track of this.
Definitely needed, thanks for looking into that.
+ if (mpz_cmp_ui (res, 1) <= 0)
+mpz_add_ui (res, res
Ciao Niels,
17 feb 2024, 17:53 da ni...@lysator.liu.se:
> Niels Möller writes:
> The documented conditions say that gmp should return the same cofactors
>
The documentation also says "If abs(a) = abs(b), then s = 0, t = sgn(b)."
>
> canonicalization logic at the end wasn't right. Appending a
Ciao,
17 feb 2024, 19:15 da :
> Ciao Niels,
>
> 17 feb 2024, 17:53 da ni...@lysator.liu.se:
>
>> Niels Möller writes:
>> The documented conditions say that gmp should return the same cofactors
>>
>
> The documentation also says "If abs(a) = abs(b), then s = 0, t = sgn(b)."
>
Maybe we should
Ciao Niels,
17 feb 2024, 21:26 da ni...@lysator.liu.se:
> marco.bodr...@tutanota.com writes:
>
>> Maybe we should also add the test:
>>
>> /* Require that s==0 iff g==abs(b) */
>> if (!mpz_sgn (s) ^ !mpz_cmpabs (g, b))
>> goto fail;
>>
>
> Good point, that's better than only checking
Ciao Vincent,
15 dic 2023, 13:26 da vinc...@vinc17.net:
> Note that there are similar issues in printf/repl-vsnprintf.c, and I
>
I finally had the time to examine the code and test it. I attach a proposed
patch.
I changed the 3 files: printf/doprntf.c, printf/repl-vsnprintf.c,
Ciao Niels,
18 feb 2024, 10:10 da ni...@lysator.liu.se:
> marco.bodr...@tutanota.com writes:
>
>> What about;
>>
>>
>> /* Arrange so that |s| < |u| / 2g */
>> mpz_add (s1, s0, s1);
>> {
>> int cmp = mpz_cmpabs (s0, s1);
>> if (cmp >= 0)
>> {
>> mpz_swap (s0, s1);
>>
Ciao,
13 dic 2023, 15:53 da vinc...@vinc17.net:
> On 2023-12-03 20:19:10 +0100, Vincent Lefevre wrote:
>
>> With GMP 6.3.0, the formatted output functions do not handle %c
>> with the value 0 correctly. For gmp_sprintf, the return value is
>> incorrect.
>>
> In printf/sprintffuns.c, function
Ciao,
24 mar 2024, 10:59 da cas...@gmail.com:
> Hi,
>
> In millerrabin.c, there are conflicting definitions for millerrabin().
>
> The prototype is:
>
I removed the prototype, by swapping the function order :-)
Thanks.
m
___
gmp-bugs mailing list
Ciao,
18 feb 2024, 12:29 da marco.bodr...@tutanota.com:
> 15 dic 2023, 13:26 da vinc...@vinc17.net:
>
>> Note that there are similar issues in printf/repl-vsnprintf.c, and I
>>
>
> I finally had the time to examine the code and test it. I attach a proposed
> patch.
>
Vincent, you did not
73 matches
Mail list logo