Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bbapi_srs.cpp
Go to the documentation of this file.
1
11
12namespace bb::bbapi {
13
15{
16 // Parse G1 points from buffer (64 bytes each)
17 std::vector<g1::affine_element> g1_points(num_points);
18 for (size_t i = 0; i < num_points; ++i) {
19 g1_points[i] = from_buffer<g1::affine_element>(points_buf.data(), i * 64);
20 }
21
22 // Parse G2 point from buffer (128 bytes)
23 auto g2_point_elem = from_buffer<g2::affine_element>(g2_point.data());
24
25 // Initialize BN254 SRS
26 bb::srs::init_bn254_mem_crs_factory(g1_points, g2_point_elem);
27
28 return {};
29}
30
32{
33 // Parse Grumpkin affine elements from buffer
35 for (uint32_t i = 0; i < num_points; ++i) {
36 points[i] =
37 from_buffer<curve::Grumpkin::AffineElement>(points_buf.data(), i * sizeof(curve::Grumpkin::AffineElement));
38 }
39
40 // Initialize Grumpkin SRS
42
43 return {};
44}
45
46} // namespace bb::bbapi
SRS (Structured Reference String) initialization command definitions for the Barretenberg RPC API.
typename Group::affine_element AffineElement
Definition grumpkin.hpp:63
#define BB_UNUSED
void init_grumpkin_mem_crs_factory(std::vector< curve::Grumpkin::AffineElement > const &points)
void init_bn254_mem_crs_factory(std::vector< g1::affine_element > const &points, g2::affine_element const &g2_point)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Response execute(BBApiRequest &request) &&
Definition bbapi_srs.cpp:31
Response execute(BBApiRequest &request) &&
Definition bbapi_srs.cpp:14