mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
231e468e19
git-subtree-dir: erigon-lib git-subtree-mainline:3c8cbda809
git-subtree-split:93d9c9d9fe
22 lines
677 B
C++
22 lines
677 B
C++
#ifndef STARKWARE_CRYPTO_PEDERSEN_HASH_H_
|
|
#define STARKWARE_CRYPTO_PEDERSEN_HASH_H_
|
|
|
|
#include "gsl-lite.hpp"
|
|
|
|
#include "prime_field_element.h"
|
|
|
|
namespace starkware {
|
|
|
|
/*
|
|
Computes the Starkware version of the Pedersen hash of x and y.
|
|
The hash is defined by:
|
|
shift_point + x_low * P_0 + x_high * P1 + y_low * P2 + y_high * P3
|
|
where x_low is the 248 low bits of x, x_high is the 4 high bits of x and similarly for y.
|
|
shift_point, P_0, P_1, P_2, P_3 are constant points generated from the digits of pi.
|
|
*/
|
|
PrimeFieldElement PedersenHash(const PrimeFieldElement& x, const PrimeFieldElement& y);
|
|
|
|
} // namespace starkware
|
|
|
|
#endif // STARKWARE_CRYPTO_PEDERSEN_HASH_H_
|