mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-27 22:28:21 +00:00
c4805e0262
* issue/issue-281-create_binding_to_pedersen_hash * Add //nolint * Add more nolints * move nolint * Remove nolit * Add gcc install * Upd .ci * Remove staticcheck * Add envs * try to exclude pedersen_hash from test * try to fix mac os build * Add include for mac os * Add include for mac os * Fix runner_os * remove test for macos * Change restrictions * restrict tests to ubuntu * Try test windows * Add build constraint
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_
|