|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <field_conversion.hpp>
Public Types | |
| using | DataType = bb::fr |
| using | fr = bb::fr |
| using | fq = grumpkin::fr |
| using | bn254_point = curve::BN254::AffineElement |
| using | grumpkin_point = curve::Grumpkin::AffineElement |
Static Public Member Functions | |
| template<typename T > | |
| static constexpr size_t | calc_num_fields () |
| static fq | convert_grumpkin_fr_from_bn254_frs (std::span< const bb::fr > fr_vec) |
| Converts 2 bb::fr elements to fq. | |
| static std::vector< bb::fr > | convert_grumpkin_fr_to_bn254_frs (const fq &val) |
| Converts fq to 2 bb::fr elements (inverse of the above). | |
| template<typename T > | |
| static T | deserialize_from_fields (std::span< const fr > fr_vec) |
| template<typename T > | |
| static std::vector< fr > | serialize_to_fields (const T &val) |
| Conversion from transcript values to bb::frs. | |
| static std::array< bb::fr, 2 > | split_challenge (const bb::fr &challenge) |
| Split a challenge field element into two half-width challenges. | |
| template<typename T > | |
| static T | convert_challenge (const bb::fr &challenge) |
Convert an fr challenge to a target type (fr or fq). Assumes challenge is "short". | |
Definition at line 19 of file field_conversion.hpp.
Definition at line 24 of file field_conversion.hpp.
| using bb::FrCodec::DataType = bb::fr |
Definition at line 21 of file field_conversion.hpp.
| using bb::FrCodec::fq = grumpkin::fr |
Definition at line 23 of file field_conversion.hpp.
| using bb::FrCodec::fr = bb::fr |
Definition at line 22 of file field_conversion.hpp.
Definition at line 25 of file field_conversion.hpp.
|
inlinestaticconstexpr |
Definition at line 28 of file field_conversion.hpp.
|
inlinestatic |
Convert an fr challenge to a target type (fr or fq). Assumes challenge is "short".
Definition at line 179 of file field_conversion.hpp.
|
inlinestatic |
Converts 2 bb::fr elements to fq.
Splits into 136-bit lower chunk and 118-bit upper chunk to mirror stdlib bigfield limbs (68-bit each).
Definition at line 46 of file field_conversion.hpp.
|
inlinestatic |
Converts fq to 2 bb::fr elements (inverse of the above).
Definition at line 67 of file field_conversion.hpp.
|
inlinestatic |
Definition at line 89 of file field_conversion.hpp.
|
inlinestatic |
Conversion from transcript values to bb::frs.
Definition at line 125 of file field_conversion.hpp.
|
inlinestatic |
Split a challenge field element into two half-width challenges.
lo is 128 bits and hi is 126 bits which should provide significantly more than our security parameter bound: 100 bits. The decomposition is constrained to be unique.
| challenge |
Definition at line 164 of file field_conversion.hpp.