14 Commits

Author SHA1 Message Date
Jakub Nabaglo
609028c899
Poseidon-12 in hand-rolled ASM (#276)
* Goldilocks Poseidon-12 in asm

* Lints

* Hamish comments

* Reorganize arch-specific files
2021-10-13 09:47:50 -07:00
wborgeaud
1a508d0c19
Merge pull request #270 from mir-protocol/poseidon_8
Use `SPONGE_WIDTH` instead of hardcoded values in various places
2021-09-27 12:55:46 +02:00
wborgeaud
747c9f894b Back to width 12 2021-09-26 20:09:26 +02:00
Daniel Lubarov
f382289896
Derive challenges from other proof fields (#262)
* Derive challenges from other proof fields

* Delete failing test

Seems really hard to get the challenges right with the new model.

* Move PoW check

* Other feedback
2021-09-25 19:41:48 -07:00
wborgeaud
1a55538e23 8->SPONGE_WIDTH in most places 2021-09-24 15:50:48 +02:00
wborgeaud
42a7ff9cc2 Working 2021-09-24 13:06:07 +02:00
Daniel Lubarov
43cbb84cc9
Have verify_merkle_proof call permute_swapped (#257)
Rather than adding the gate "manually".
2021-09-21 12:29:37 -07:00
wborgeaud
5488be2acd Add HashGate constant type 2021-09-17 13:15:22 +02:00
wborgeaud
b63d83aacf Add Poseidon gadget 2021-09-16 21:18:08 +02:00
Jakub Nabaglo
de1d5d0ad2
Minor: fix a few warnings (#239)
* Minor: fix a few warnings

* Lints
2021-09-13 15:42:59 -07:00
Daniel Lubarov
c76eb9ddeb
Prepare for the switch to Poseidon (#228)
* Prepare for the switch to Poseidon

Everything will now select a permutation based on the `PERMUTATION_FAMILY` const.

The `Poseidon` variant won't work quite yet since the gate isn't in place; I left that as a `todo!()`

* fix
2021-09-13 10:22:25 -07:00
Daniel Lubarov
3bc34c59d8
Refactor GMiMC code (#224)
* Refactor GMiMC code

Adds a sub-trait of `Field` called `GMiMCInterface`, which is similar to `PoseidonInterface`.

This lets us have different fields with different GMiMC constants in a type-safe way.

* Remove `Interface`

* Const generic for width
2021-09-07 18:28:28 -07:00
Daniel Lubarov
236a143abf
Move some Field members to a Field64 subtrait (#213)
* Move some Field members to a Field64 subtrait

I.e. move anything specific to 64-bit fields.

Also, relatedly,
- Tweak a bunch of prover code to require `Field64`, since 64-bit stuff is used in a couple places, like the FRI proof-of-work
- Remove `bits()`, which was unused and assumed a 64-bit field
- Rename a couple methods to reflect that they're u64 variants

There are no functional changes.

* Field64 -> PrimeField

* Remove `exp_u32`, `kth_root_u32`

* PrimeField: PrimeField

* Move `to_canonical_biguint` as well

* Add back from_noncanonical_u128
2021-09-05 10:27:11 -07:00
Daniel Lubarov
018fb005f8
Move stuff around (#135)
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
2021-07-29 22:00:29 -07:00