| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
`core:math/big` has been verified against Python's big integer implementation long enough.
Turn it into a regular regression test using the `core:testing` framework, testing against
a generated corpus of test vectors.
|
| |
|
|
|
|
|
|
| |
In September 2022, the Python team addressed a possible DoS issue converting big integers to and from base 10 strings: https://github.com/python/cpython/issues/95778
Converting to/from base 10 is a quadratic operation, so they limited it to 4300 digits: https://discuss.python.org/t/int-str-conversions-broken-in-latest-python-bugfix-releases/18889/83
Github CI still uses an old Python version which parsed our test suite just fine. This patch converts them to hex literals to ensure our test doesn't break when Github does update to a non-vulnerable Python version released after September 2022.
|
| |
|
|
|
|
|
|
|
|
|
| |
`_DIGIT_NAILS` is defined as 4, meaning that we use 60 out of every 64 bits.
We can use as few as 1 nail, using 63 bits out of every 64, and all tests will still pass.
However, it needs more testing to see if that's a worthwhile change to make.
For the tests to work properly when changing the nails, Python needs to know about it as well.
In addition, compile the big math code with `-o:speed` going forward.
|
| |
|
|
|
| |
Same for the SHR variant. These are pure implementation details to shift by a leg/word at a time.
Prevent accidental usage.
|
| | |
|
| | |
|
| |
|