2237 Commits

Author SHA1 Message Date
wborgeaud
8e711d413a Minor 2022-07-05 16:41:28 +02:00
wborgeaud
ee80fa4a39 Minor 2022-07-05 16:19:23 +02:00
wborgeaud
8873eaba11 Find labels before assembly 2022-07-05 16:11:55 +02:00
wborgeaud
7364248e60 Fixes 2022-07-05 15:43:41 +02:00
wborgeaud
eed7cde388 Add moddiv for testing 2022-07-05 15:01:40 +02:00
wborgeaud
8a44c557c5 Curve mul assembly 2022-07-05 12:11:35 +02:00
wborgeaud
4d37685744 Comment 2022-07-05 11:12:56 +02:00
wborgeaud
a5988d6c26 Simplify 2022-07-05 11:09:25 +02:00
wborgeaud
4cdbb8c1a9 Minor 2022-07-05 10:47:29 +02:00
wborgeaud
6db8539bc8 Minor 2022-07-05 10:46:07 +02:00
wborgeaud
683efc0d74 Impl double 2022-07-05 10:45:26 +02:00
wborgeaud
92bb8d5fa9 Merge branch 'main' into elliptic_curve_asm
# Conflicts:
#	evm/src/cpu/kernel/ast.rs
2022-07-05 09:03:19 +02:00
Daniel Lubarov
5d74a19ad6 Add test (won't work for a while, but to illustrate) 2022-07-04 18:10:03 -07:00
Daniel Lubarov
c389abc140 other segments 2022-07-02 23:17:33 -07:00
Daniel Lubarov
28603b85d1 fixes 2022-07-01 10:09:57 -07:00
Daniel Lubarov
e7b480deaf Begin work on witness generation and kernel bootstrapping 2022-07-01 10:09:57 -07:00
Daniel Lubarov
f6d48f1328
Serialize zero as [0] rather than [] in bytecode (#592) 2022-07-01 09:29:56 -07:00
wborgeaud
797bece7bd First attempt 2022-07-01 18:28:22 +02:00
Jacqueline Nabaglo
bc9e618967
Structured wrapper over CPU table row (#589)
* Structured wrapper over CPU table row

* Lints

* minor style

* Minor cleanup
2022-06-29 16:23:44 -07:00
wborgeaud
33cabb14de
Merge pull request #587 from mir-protocol/s_columns_registers
`registers` -> `columns`
2022-06-29 04:12:31 -05:00
wborgeaud
f30889b7d7 NUM_REGISTERS -> NUM_COLUMNS 2022-06-29 10:06:46 +02:00
wborgeaud
7812ad242c s/registers/columns 2022-06-29 10:02:03 +02:00
Hamish Ivey-Law
aa42312126
EVM Arithmetic Stark table (#559)
* 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.

* Clean up 'decode.rs'.

* Fold 'decode.rs' into 'arithmetic_stark.rs'.

* Force limb size to divide EVM register size.

* Document range-check warning and fix end value calc.

* Convert `debug_assert!`s into `assert!`s.

* Clean up various kinds of iterator usage.

* Remove unnecessary type spec.

* Document unexpected use of `collect`.
2022-06-29 11:56:48 +10:00
Daniel Lubarov
dec0765fb5
Tweak Merkle proof API and make it public (#588)
- Add `_to_cap` to existing methods for clarity
- Add variants which deal with Merkle roots instead of caps
- Simplify `verify_merkle_proof_to_cap` - it can call `verify_merkle_proof_to_cap_with_cap_index`
- Make them all public except `verify_merkle_proof_to_cap_with_cap_index`, which is pretty niche
2022-06-27 20:39:47 -07:00
Jacqueline Nabaglo
e3834a5335
Util for assembling EVM code to hex (#586)
This is just for debugging the kernel. It's fully disposable.
2022-06-27 18:08:03 -07:00
wborgeaud
b228cc72fe s/columns/registers 2022-06-28 02:28:25 +02:00
Daniel Lubarov
34e73db42b
Memory naming tweaks (#579)
* Memory naming tweaks

- Define the channel count and value limbs in a single place, so they're easy to adjust.
- Standardize on "channels" which I think is more explicit, since e.g. `num_mem_ops` used to mean either the channel count or total operation count in a trace.

* feedback

* tweaks

* fmt
2022-06-27 16:03:56 -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
475964a6bb
Move CTL config out of test (#578)
* Move CTL config out of test

Since the same config will be used in other tests (and maybe external callers, unless we add an API later to abstract it).

* fmt

* Split up CTLs
2022-06-27 10:40:16 -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
Daniel Lubarov
7b75eaa98d
ASM macro support (#580)
* ASM macro support

Also recognize global labels as a PUSH target; previously it only considered local labels.

* macro test
2022-06-25 23:10:08 -07:00
Jacqueline Nabaglo
912281de9b
CTL: limbs (CPU) <-> bits (logic) (#577)
* CTL: limbs (CPU) <-> bits (logic)

* Minor: stray TODO mark

* Document Zero op

* Util for constructing an int from bits
2022-06-25 13:34:04 -07:00
Jacqueline Nabaglo
46df1bb6b2
Fix EVM dependency list (#576) 2022-06-23 18:33:34 -07:00
Jacqueline Nabaglo
191ddf7bc1
Exponentiation kernel function (#574)
* Exponentiation kernel function

* Exponentiation: Hamish comments
2022-06-23 15:33:55 -07:00
Nicholas Ward
af0e32506a
Merge pull request #571 from mir-protocol/evm_memory
EVM memory stark
2022-06-23 14:50:30 -07:00
Nicholas Ward
4a7ebf057b updated in line with main changes 2022-06-23 14:36:14 -07:00
Nicholas Ward
791b15f94f cleanup 2022-06-23 14:01:22 -07:00
Nicholas Ward
4d69998cde fix and cleanup 2022-06-23 14:01:22 -07:00
Nicholas Ward
d911eecd37 fixes 2022-06-23 14:01:22 -07:00
Nicholas Ward
798b01d050 added lookup file 2022-06-23 14:01:22 -07:00
Nicholas Ward
29fa32465c fixes 2022-06-23 14:01:22 -07:00
Nicholas Ward
d6983951a4 attempted fix 2022-06-23 14:01:22 -07:00
Nicholas Ward
f04f2bc381 multiple indices per timestamp 2022-06-23 14:01:22 -07:00
Nicholas Ward
f16db8c564 fmt 2022-06-23 14:01:22 -07:00
Nicholas Ward
593d3eeffd fixes 2022-06-23 14:01:22 -07:00
Nicholas Ward
9434819829 addressed comments 2022-06-23 14:01:22 -07:00
Nicholas Ward
a7f6bf3b00 fmt 2022-06-23 14:01:22 -07:00
Nicholas Ward
de52e630e8 addressed comments 2022-06-23 14:01:22 -07:00
Nicholas Ward
2d7f2b47c2 fmt 2022-06-23 14:01:22 -07:00