Commit Graph

2 Commits

Author SHA1 Message Date
Georg Wiese
cbc5dd118e Fix soundness bug in permutation argument (#1386)
This fixes a soundness bug in the recently added permutation argument:
To fingerprint a list $A = (a_1, ..., a_n)$ with selectors $S = (s_1,
..., s_n)$, we were computing:

$$
\prod_{i = 1}^n (X - s_i \cdot a_i)
$$

As a result, any element $a_i$ can be replaced with $0$, by setting the
selector to $0$!

Now, an element $i$ with $s_i = 0$ does not contribute to the product
anymore:

$$
\prod_{i = 1}^n (s_i \cdot (X - a_i - 1) + 1)
$$
2024-05-18 08:29:09 +00:00
Georg Wiese
a917e4f35a Add permutation to PIL STD (#1297)
First part of #1296 

This PR adds a `permutation()` function to the standard library. The
code is inspired by the `permutation_via_challenges` test (removed now),
[this
comment](https://github.com/powdr-labs/powdr/issues/424#issuecomment-1931686047)
by @chriseth and [this Halo2
implementation](https://github.com/privacy-scaling-explorations/halo2/blob/main/halo2_proofs/examples/shuffle.rs).
2024-04-25 07:32:35 +00:00