|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <field_conversion.hpp>
Public Types | |
| using | DataType = uint256_t |
| using | fr = bb::fr |
| using | fq = grumpkin::fr |
| using | bn254_commitment = curve::BN254::AffineElement |
| using | grumpkin_commitment = curve::Grumpkin::AffineElement |
Static Public Member Functions | |
| template<typename T > | |
| static constexpr size_t | calc_num_fields () |
| template<typename T > | |
| static T | deserialize_from_fields (std::span< const uint256_t > vec) |
| template<typename T > | |
| static std::vector< uint256_t > | serialize_to_fields (const T &val) |
Conversion from transcript values to uint256_ts. | |
| static std::array< uint256_t, 2 > | split_challenge (const uint256_t &challenge) |
| Split a challenge field element into two equal-width challenges. | |
| template<typename T > | |
| static T | convert_short_challenge (const bb::fr &challenge) |
| Convert a short (≤127-bit limb) challenge to a target type (fr or fq). | |
| template<typename T > | |
| static T | convert_full_challenge (const bb::fr &challenge) |
Convert a full-width challenge to a target type (fr or fq); exact since r < q. | |
Definition at line 243 of file field_conversion.hpp.
Definition at line 248 of file field_conversion.hpp.
| using bb::U256Codec::DataType = uint256_t |
Definition at line 245 of file field_conversion.hpp.
| using bb::U256Codec::fq = grumpkin::fr |
Definition at line 247 of file field_conversion.hpp.
| using bb::U256Codec::fr = bb::fr |
Definition at line 246 of file field_conversion.hpp.
Definition at line 249 of file field_conversion.hpp.
|
inlinestaticconstexpr |
Definition at line 252 of file field_conversion.hpp.
|
inlinestatic |
Convert a full-width challenge to a target type (fr or fq); exact since r < q.
Definition at line 381 of file field_conversion.hpp.
|
inlinestatic |
Convert a short (≤127-bit limb) challenge to a target type (fr or fq).
Definition at line 366 of file field_conversion.hpp.
|
inlinestatic |
Definition at line 268 of file field_conversion.hpp.
|
inlinestatic |
Conversion from transcript values to uint256_ts.
Definition at line 311 of file field_conversion.hpp.
|
inlinestatic |
Split a challenge field element into two equal-width challenges.
Both lo and hi are 127 bits each (254/2) which provides significantly more than our security parameter bound: 100 bits. The decomposition is constrained to be unique.
| challenge |
Definition at line 350 of file field_conversion.hpp.