Commit Graph
81 Commits
Author SHA1 Message Date
Paul Gebheim 40d3c6dd0d Merge pull request #1294 from matthiasgoergens/matthias/make-clippy-happy
Make clippy happy
2023-11-15 19:54:55 -08:00
shuoer86 a0ea26f4b2 Fix typos in comments 2023-11-04 23:07:36 +08:00
Matthias Goergens f92427021c Make clippy happy
Nightly has added more clippy rules.
2023-10-16 13:43:16 +08:00
BGluth 5936c67f59 Now refers to sub-crates using paths (and removed patch section)
- Previously refered to specific `crates.io` versions.
- Motivation for this is to allow external projects to be able use
  specific revisions of this repo. Without this, a `[patch]` section
  is almost always required in the external project in order to force
  the internal plonky2 sub-crates to the same version, an approach which
  comes with its own issues.
2023-09-07 16:36:38 -06:00
Robin Salen 1997bf242b Implement inverse from Fermat little theorem (#1176)
* Add inverse from Fermat little theorem

* Remove inlining for goldilocks try_inverse method
2023-08-19 00:50:08 +10:00
Jacqueline Nabaglo b2626fdc71 Merge pull request #1162 from topos-protocol/cleanup_attributes
Remove unused attributes
2023-08-04 13:11:25 -07:00
Hamish Ivey-Law c9bd32d5cf Fix trait import. (#1163) 2023-08-02 23:24:03 +10:00
Robin Salen 9f8c152222 Remove unused attributes 2023-08-02 08:54:20 -04:00
Nicholas Ward 3a55602909 update versions for crates.io updates 2023-07-31 16:31:22 -07:00
Robin Salen 04657d246b Fix import 2023-07-16 11:21:56 -04:00
dependabot[bot] 5d513207ef Update itertools requirement from 0.10.3 to 0.11.0
Updates the requirements on [itertools](https://github.com/rust-itertools/itertools) to permit the latest version.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.3...v0.11.0)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-13 23:00:00 +00:00
Nicholas Ward 2d7a94de6a formatting 2023-07-11 12:05:22 -07:00
Matthias Goergens 4df4d86555 No default implementation 2023-07-04 17:21:27 +08:00
Matthias Goergens 6122dccb6e Move operations to Field
Implement the TODOs and move `from_noncanonical_u64` and `from_noncanonical_i64` from `Field64` to `Field`.
2023-06-28 18:44:47 +08:00
Hamish Ivey-Law 653a6b15de Remove generic_const_exprs dependency from field crate. (#1020) 2023-05-04 07:28:50 +10:00
Robin Salen f7f5fb4e93 Change display for GoldilocksField 2023-04-20 07:59:34 +02:00
Robin Salen bb2233cb21 Override from_noncanonical_u96() for Goldilocks field 2023-03-16 10:27:26 -04:00
Daniel Lubarov 137bc78565 Prep for publishing to crates.io 2023-01-30 13:18:06 -08:00
Hamish Ivey-Law 2501386004 Add missing feature to field crate. (#818) 2022-11-18 15:00:58 +11:00
Brandon H. Gomes 9f4dc3464e fix: add architecture gating for inline-assembly
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 20:04:57 -07:00
Brandon H. Gomes fc3f63398d wip: start moving starky to no-std
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 12:17:03 -07:00
Brandon H. Gomes e2cdd5a954 feat: upgrade Sampling APIs
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 08:26:03 -07:00
Brandon H. Gomes 7a81c5d46a feat: move to alloc for Vec/String/Box
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 19:59:12 -07:00
Brandon H. Gomes 6fd0da216a fix: remove unstable features from plonky2
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 17:50:31 -07:00
wborgeaud b97ec3bda1 New clippy lint 2022-10-25 10:50:40 +02:00
Daniel Lubarov 443a070003 Clippy fix 2022-10-08 14:09:18 -07:00
Hamish Ivey-Law d7bb47318c Modular operations for the EVM arithmetic unit (#755)
* First draft of 256-bit addition.

* Update comment.

* cargo fmt

* Rename addition evaluation file.

* Port ALU logic from SZ.

* Give a name to some magic numbers.

* `addition.rs` -> `add.rs`; fix carry propagation in add; impl sub.

* Clippy.

* Combine hi and lo parts of the output.

* Implement MUL.

* Suppress Clippy's attempt to make my code even harder to read.

* Next draft of MUL.

* Make all limbs (i.e. input and output) 16-bits.

* Tidying.

* Use iterators instead of building arrays.

* Documentation.

* Clippy is wrong; also cargo fmt.

* Un-refactor equality checking, since it was wrong for sub.

* Daniel comments.

* Daniel comments.

* Rename folder 'alu' -> 'arithmetic'.

* Rename file.

* Finish changing name ALU -> Arithmetic Unit.

* Finish removing dependency on array_zip feature.

* Remove operations that will be handled elsewhere.

* Rename var; tidy up.

* Clean up columns; mark places where range-checks need to be done.

* Import all names in 'columns' to reduce verbiage.

* cargo fmt

* Fix aux_in calculation in mul.

* Remove redundant 'allow's; more precise range-check size.

* Document functions.

* Document MUL instruction verification technique.

* Initial tests for ADD.

* Minor test fixes; add test for SUB.

* Fix bugs in generate functions.

* Fix SUB verification; refactor equality verification.

* cargo fmt

* Add test for MUL and fix some bugs.

* Update doc.

* Quiet incorrect clippy error.

* Initial implementation of ADDMOD and MOD.

* Fixes to addmod.

* Update doc.

* Do 1000 random tests instead of just 1.

* Documentation fix.

* Working version of ADDMOD.

* Working version of MOD.

* Name magic number; do multiple MUL tests.

* Add code and test for special case; add some docs.

* Fix spelling mistake.

* Simplify asserts.

* Tidy comment.

* Remove unused module.

* cargo fmt

* Check that output is reduced.

* Add conversion of canonical `i64` to a `Field64`.

* Handle zero modulus within degree constraint.

* cargo fmt

* Fix some comments.

* Check that the top half of the product is zero!

* Start of refactor.

* Refactoring.

* Remove zero and reduction handling from addmod.

* Refactoring; renaming; bug fixes.

* Reuse intermediate calculations across all modular operations; don't negate quot poly unnecessarily.

* Fix bug where last elt of q*m wasn't checked.

* Refactoring.

* Move circuit poly functions to utils.rs.

* Rename ADDMOD stuff to MODULAR.

* Rename module addmod -> modular.

* Handle zero modulus.

* Verify that output is reduced.

* Implement recursive version of modular circuits.

* clippy

* Tidy up i64 -> Field conversion following Jacqui's comments.

* cargo fmt

* Improved documentation.

* Address Jacqui's comments.

* Save some gates by using builder.arithmetic_extension().
2022-10-07 17:15:50 +11:00
Nicholas Ward 33d97eff1c moved sqrt to PrimeField 2022-09-26 11:31:11 -07:00
Nicholas Ward a053372176 cleanup and documentation 2022-09-26 11:19:09 -07:00
Nicholas Ward 3bc1e65a7a fix 2022-09-26 11:11:41 -07:00
Nicholas Ward 4668e8c5f8 clippy 2022-09-26 10:45:20 -07:00
Nicholas Ward 59acd9436c fmt 2022-09-26 10:44:51 -07:00
Nicholas Ward 880bc87bb1 sqrt 2022-09-26 10:43:18 -07:00
wborgeaud 3007b5e779 Fix DTH_ROOT for degree 1 extension 2022-09-19 11:25:21 +02:00
wborgeaud a930c1a823 s/l1/l0 2022-09-12 08:09:17 +02:00
Daniel Lubarov 2c77247d43 Keccak sponge STARK
It contains a row for each absorb step of the sponge.
2022-09-01 09:41:19 -07:00
Daniel Lubarov e87392bdba comment 2022-08-22 11:32:36 -07:00
Daniel Lubarov 464b23297c Check each PolynomialValues len
I.e. that it is the length of some power-of-two subgroup.
2022-08-22 11:16:24 -07:00
Daniel Lubarov 3a6bbd825c Merge pull request #677 from mir-protocol/u160_comments
Tweak comments
2022-08-19 18:28:49 -07:00
Daniel Lubarov 831a671872 Tweak comments 2022-08-19 10:35:02 -07:00
Daniel Lubarov 2fd5fbbe01 Change from_biguint's behavior with extension fields
These appear to be unused for extension fields, so we're free to change the mapping without breaking anything.

As the TODO says, the mapping that's currently implemented doesn't seem natural or useful. It seems more natural to treat the `BigUint` as a base field element, potentially in a non-canonical form.
2022-08-19 09:21:10 -07:00
Daniel Lubarov a7618ef7df Merge branch 'licenses' 2022-08-16 09:01:16 -07:00
Daniel Lubarov bf4e7ff3b7 Feedback 2022-08-15 17:17:05 -07:00
Daniel Lubarov c56b7c8118 Expand inverse_2exp comment 2022-08-15 16:17:32 -07:00
Daniel Lubarov faa75178a2 MIT + Apache2 licenses 2022-08-15 07:43:00 -07:00
Sladuca e7216f2683 feature-gate rand 2022-08-06 11:35:41 -04:00
Daniel Lubarov e7b480deaf Begin work on witness generation and kernel bootstrapping 2022-07-01 10:09:57 -07:00
Daniel Lubarov e73d01a037 packed_field -> packed (#584)
* `packed_field` -> `packed`

For cleaner imports; "field" is usually clear from context

* fix
2022-06-27 15:07:52 -07:00
Daniel Lubarov 3346d3f902 field_types -> types (#583)
* `field_types` -> `types`

Here too, I think "field" is usually clear from context, e.g. in `use plonky2::field::types::Field;`.

* fixes

* fmt
2022-06-27 12:24:09 -07:00
Daniel Lubarov 410e03349c extension_field -> extension (#581)
It seems redundant in most contexts, e.g. `use plonky2::field::extension_field::Extendable;`. One could import `extension_field`, but it's not that common in Rust, and `field::extension` is now about as short.
2022-06-27 07:18:21 -07:00