github.com/ledgerwatch/erigon-lib@v1.0.0/pedersen_hash/pedersen_hash.h (about) 1 #ifndef STARKWARE_CRYPTO_PEDERSEN_HASH_H_ 2 #define STARKWARE_CRYPTO_PEDERSEN_HASH_H_ 3 4 #include "gsl-lite.hpp" 5 6 #include "prime_field_element.h" 7 8 namespace starkware { 9 10 /* 11 Computes the Starkware version of the Pedersen hash of x and y. 12 The hash is defined by: 13 shift_point + x_low * P_0 + x_high * P1 + y_low * P2 + y_high * P3 14 where x_low is the 248 low bits of x, x_high is the 4 high bits of x and similarly for y. 15 shift_point, P_0, P_1, P_2, P_3 are constant points generated from the digits of pi. 16 */ 17 PrimeFieldElement PedersenHash(const PrimeFieldElement& x, const PrimeFieldElement& y); 18 19 } // namespace starkware 20 21 #endif // STARKWARE_CRYPTO_PEDERSEN_HASH_H_