STARK curve
Pedersen hash makes use of the following STARK friendly elliptic curve over \(\mathbb{F}_p\):
\[y^2=x^3+\alpha x +\beta\]
where
-
\(\alpha=1\)
-
\(\beta = 3141592653589793238462643383279502884197169399375105820974944592307816406665\)
Definition
Given an input \((a,b)\in\mathbb{F}_p^2\), we begin by breaking it into \(a_{low}, a_{high}, b_{low}, b_{high}\), where the low part consists of the low 248 bits of the element and the high part consists of the high 4 bits of the element. Our Pedersen hash is then defined by:
\[h(a,b) = \left[shift\_point + a_{low} \cdot P_0 + a_{high} \cdot P1 + b_{low} \cdot P2 + b_{high} \cdot P3\right]_x\]
where the values of the constants \(shift\_point, P_0, P_1, P_2, P_3\) can be found in fast_pedersen_hash.py, and \([P]_x\) denotes the \(x\) coordinate of the point \(P\).