Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count big bits in u64 instead of usize #143

Merged
merged 2 commits into from
Apr 15, 2020
Merged

Commits on Apr 4, 2020

  1. Count big bits in u64 instead of usize

    A 32-bit target _could_ create a giant `BigUint` over 2²⁹ bytes = 512MB,
    not that this would be computationally useful, but that value would have
    more than `usize::MAX` bits. To avoid that possibility of overflow, we
    can better represent bit counts in `u64`.
    
    For 64-bit targets, a `BigUint` over 2⁶¹ bytes is not realistic.
    
    This changes the public API in the return values of `bits()` and
    `trailing_zeros()`, as well as the `bit_size` parameter of `RandBigInt`
    and `RandomBits`. Trying to randomize an absurd size will naturally
    cause a capacity overflow, just as if you'd made a huge `Vec`.
    cuviper committed Apr 4, 2020
    Configuration menu
    Copy the full SHA
    4bab803 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2020

  1. Fix ci/big_rand for u64 bits

    cuviper committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    6d25cab View commit details
    Browse the repository at this point in the history