9 Commits

Author SHA1 Message Date
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
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
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
Sladuca
e7216f2683 feature-gate rand 2022-08-06 11:35:41 -04: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
cfe52ad604
Add PrimeField, PrimeField64 traits (#457)
* Add PrimeField, PrimeField64 traits

* fix

* fixes

* fix

* `to_biguint` -> `to_canonical_biguint`
2022-02-09 21:50:18 -08:00
Daniel Lubarov
c126641c5d
Split into crates (#406)
* Split into crates

I kept other changes to a minimum, so 95% of this is just moving things. One complication that came up is that since `PrimeField` is now outside the plonky2 crate, these two impls now conflict:
```
impl<F: PrimeField> From<HashOut<F>> for Vec<u8> { ... }
impl<F: PrimeField> From<HashOut<F>> for Vec<F> { ... }
```
with this note:
```
note: upstream crates may add a new impl of trait `plonky2_field::field_types::PrimeField` for type `u8` in future versions
```
I worked around this by adding a `GenericHashOut` trait with methods like `to_bytes()` instead of overloading `From`/`Into`. Personally I prefer the explicitness anyway.

* Move out permutation network stuff also

* Fix imports

* Fix import

* Also move out insertion

* Comment

* fmt

* PR feedback
2021-12-28 11:51:13 -08:00