Skip to content
Snippets Groups Projects
Commit d33e5b41 authored by Niels Möller's avatar Niels Möller
Browse files

(nettle_mpz_set_sexp): Use

nettle_mpz_set_str_256_s, to handle negative numbers correctly.

Rev: src/nettle/sexp2bignum.c:1.2
parent 899af3c0
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,13 @@ int
nettle_mpz_set_sexp(mpz_t x, unsigned limit, const struct sexp_iterator *i)
{
if (i->type == SEXP_ATOM
&& i->atom_length
&& !i->display)
{
if (limit && (8 * i->atom_length > limit))
return 0;
nettle_mpz_set_str_256(x, i->atom_length, i->atom);
nettle_mpz_set_str_256_s(x, i->atom_length, i->atom);
return !limit || mpz_sizeinbase(x, 2) <= limit;
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment