Commit b3be4710 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

py/mpz: Normalize (remove leading zeros) xor operation result.

parent b56c635d
......@@ -285,7 +285,11 @@ STATIC mp_uint_t mpn_xor(mpz_dig_t *idig, const mpz_dig_t *jdig, mp_uint_t jlen,
*idig = *jdig;
}
return idig - oidig;
// remove trailing zeros
for (--idig; idig >= oidig && *idig == 0; --idig) {
}
return idig + 1 - oidig;
}
/* computes i = i * d1 + d2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment