3 Commits

Author SHA1 Message Date
wborgeaud
2c06309cf7 Fix all clippy lints 2021-11-30 17:12:13 +01:00
Hamish Ivey-Law
8f59381c87
Faster modular inverse (#292)
* Working "faster" inverse algo, using u128s.

* Faster inverse_2exp for large exp.

* More inverse tests.

* Make f, g u64.

* Comments.

* Unroll first two iterations.

* Fix bug and re-unroll first two iterations.

* Simplify loop.

* Refactoring and documentation.

* Clean up testing.

* Move inverse code to inversion.rs; use in GoldilocksField.

* Bench quartic Goldilocks extension too.

* cargo fmt

* Add more documentation.

* Address Jakub's comments.
2021-10-10 10:39:02 +11:00
Daniel Lubarov
a2eaaceb34
Rework the field test code a bit (#225)
- Split it into two files, one for general `Field` tests and one for `PrimeField` tests.
- Replace most uses of `BigUint` in tests with `u64`. These uses were only applicable for `PrimeField`s, which are 64-bit fields anyway. This lets us delete the `BigUInt` conversion methods.
- Simplify `test_inputs`, which was originally written for large prime fields. Now that it's only used for 64-bit fields, I think interesting inputs are just the smallest and largest elements, and those close to 2^32 etc.
2021-09-07 14:17:15 -07:00