19 Commits

Author SHA1 Message Date
Tony Arcieri
2aade9ddcb 2021 edition upgrade; MSRV 1.56
Upgrades the edition, with changes primarily performed by
`cargo fix --edition`.

In order to keep the changes to a minimum, this doesn't include
automated idiom fixes (i.e. `cargo fix --edition-idioms`).

This is needed to unblock the edition upgrade for the RSA crate:
https://github.com/RustCrypto/RSA/pull/135
2022-02-01 16:24:03 -07:00
Friedel Ziegelmayer
3042607c90
feat: update dependencies 2019-12-11 00:48:19 +01:00
dignifiedquire
bb167d4a9a refactor: fix compiler warnings 2019-10-13 15:21:56 +02:00
Robin Lambertz
874ab0fbaa feat: no_std support
* no_std support

* Use integer log2 when possible to estimate allocations

* Remove std features from a few dependencies

* Use libm for missing funcs in nostd environment

* Use autocfg to detect presence of i128

* Better CI test for nostd environment

* Move benchmark to a separate crate

* Make the tests pass in no_std builds

* Use thumbv7m target for nostd build test

* Add documentation about the no-std compatibility

* Make zeroize and prime features no_std-compatible

* Test each feature in nostd context

* Fix mac test to work in no_std environment

* Avoid using thread_rng in nostd tests

* Fix prime tests in nostd mode

* Fix all warnings and errors

* Only test nostd builds on nightly on travis

* Travis: Only do nostd builds on nightly
2019-10-13 15:14:14 +02:00
Josh Stone
847ba7c3dd Test a range of round trips to/from_signed_bytes 2019-01-22 12:52:34 +01:00
Leonardo Yvens Schwarzstein
810f8c4b47 Fix to_signed_bytes_* for positive number with leading 0x80 2019-01-22 12:52:34 +01:00
Friedel Ziegelmayer
ad8355c2b0
feat: Lehmer GCD - and various improvements (#4) 2019-01-22 12:29:31 +01:00
dignifiedquire
73a3f1eacb improve modpow perf and fix test 2018-12-19 19:10:19 +01:00
dignifiedquire
fb29d3cd80 update names 2018-12-12 14:14:34 +01:00
dignifiedquire
f7e8af05a4 chore: run rustfmt on all code 2018-08-06 15:13:09 -07:00
Thom Wiggers
d3ef15195e
also use BigInt::from 2018-07-19 17:02:36 +02:00
Thom Wiggers
ab3594f878
Also allow BigInt.pow(&$type) 2018-07-19 17:02:36 +02:00
Thom Wiggers
3f79349614
Implement Pow directly on references 2018-07-19 17:02:35 +02:00
Thom Wiggers
136d7d9aab
Implement pow for BigInt 2018-07-19 17:02:35 +02:00
Josh Stone
ec181ea593 Update rand CI 2018-05-22 16:56:54 -07:00
Josh Stone
04252b7716 Add basic conversions for i128 and u128 2018-05-15 18:01:14 -07:00
Josh Stone
96c1d69279 Implement assignment operators for BigInt
All of these operators were already implemented for `BigUint`, so
now `BigInt` support the same use.

Closes #7.
2018-05-09 16:36:29 -07:00
Josh Stone
a849284320 Remove big_digit::* from the public API
The *idea* of `big_digit` and its type aliases is that we may someday
use something other than `u32` in the representation, perhaps even
different sizes for different targets.  That's still a possibility, but
I think it's not really feasible to expose this variation in the public
API.  Calling `BigUint::from_slice([1, 2, 3])` is only meaningful if you
know what that size is, and users can't really alternate this kind of
thing based on a type definition.  So for now, we just commit to `u32`
units in the public API, no matter what we may do internally.

This removal is a breaking change, part of the 0.2 semver bump.  If I'm
wrong and somebody can show a compelling use case for `big_digit`, we
can always add things back into the public API later.
2018-04-27 23:52:41 -07:00
Josh Stone
8964eb9887 Chop the tests up
The test modules were getting huge, and some of its functions were
actually a huge amount of code due to macros, causing tests to take a
long time just to compile.  They are now separated into a few different
tests, and the scalar macros especially are now expanded more sparingly
in just a few `check()` functions.

Test compile times for me went from about 25 seconds to 1.5s in debug
mode, and from 300 seconds (!) to about 8s in release mode.
2018-02-26 22:13:25 -08:00