Skip to content

Commit

Permalink
Update poseidon.md (#1318)
Browse files Browse the repository at this point in the history
There’s a minor error in filecoin paper

`calc_round_numbers(p,M,t,α)` is a typo… It does not receive alpha as final parameters it receives $c_{\alpha} \in {0, 1, 2}$
```
if sbox_case == 0:
    print "S-box: f(x) = x^3"
elif sbox_case == 1:
    print "S-box: f(x) = x^5"
elif sbox_case == 2:
    print "S-box: f(x) = x^(-1)"
```
It’s quite obvious so idk if anyone cares

Co-authored-by: smagdali <stefan@whitelabel.org>
Co-authored-by: cw <106938+cwaring@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 16, 2023
1 parent be66f63 commit 30aab19
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion content/algorithms/crypto/poseidon.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,15 @@ while providing security against known attacks (statistical, interpolation, and

<br/>

{{<plain>}}$\constb R_F, R_P = \texttt{calc\_round\_numbers}(p, M, t, \alpha)${{</plain>}}\
{{<plain>}}$\constb R_F, R_P = \texttt{calc\_round\_numbers}(p, M, t, c_{\alpha}})${{</plain>}}\
where the S-box case, {{<plain>}}$c_{\alpha}${{</plain>}}, is given by
{{<plain>}}
$c_{\alpha} = \begin{cases}
0 & \if \alpha = 3 \cr
1 & \if \alpha = 5 \cr
2 & \if \alpha = \neg 1
\end{cases}
{{</plain>}}\
The number of full and partial rounds, both are positive integers $R_F, R_P \typecolon \mathbb{Z}_{>0}$ and $R_F$ is even.

$R_F$ and $R_P$ are calculated using either the Python script [`calc_round_numbers.py`](https://extgit.iaik.tugraz.at/krypto/hadeshash/-/blob/9d80ec0473ad7cde5a12f3aac46439ad0da68c0a/code/scripts/calc_round_numbers.py) or the [`neptune`](https://github.com/filecoin-project/neptune) Rust library, denoted {{<plain>}}$\texttt{calc\_round\_numbers}${{</plain>}}. Both methods calculate the round numbers via brute-force; by iterating over all reasonable values for $R_F$ and $R_P$ and choosing the pair that satisfies the security inequalities (provided below) while minimizing the number of S-boxes.
Expand Down

0 comments on commit 30aab19

Please sign in to comment.