Skip to content
Snippets Groups Projects
Commit c7aa86ce authored by Damien George's avatar Damien George
Browse files

py/mpz: Strip trailing zeros from mpz value when set from bytes.

parent 5e66f2b7
No related branches found
No related tags found
No related merge requests found
......@@ -938,6 +938,8 @@ void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf)
#endif
num_bits -= DIG_SIZE;
}
z->len = mpn_remove_trailing_zeros(z->dig, z->dig + z->len);
}
bool mpz_is_zero(const mpz_t *z) {
......
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