90 template <
size_t multitable_index>
94 template <
size_t multitable_index,
size_t table_index>
98 static_assert(table_index < get_num_bits_of_multi_table<multitable_index>());
100 const auto index =
static_cast<size_t>(
key[0]);
101 return { basic_table[index].x, basic_table[index].y };
class that stores precomputed generators used for Pedersen commitments and Pedersen hashes
element class. Implements ecc group arithmetic using Jacobian coordinates See https://hyperelliptic....
group_elements::affine_element< Fq, Fr, Params > affine_element
group_elements::element< Fq, Fr, Params > element
Generates plookup tables required to perform fixed-base scalar multiplication over a fixed number of ...
std::vector< affine_element > single_lookup_table
static affine_element generate_generator_offset(const affine_element &input)
static std::optional< std::array< MultiTableId, 2 > > get_lookup_table_ids_for_point(const affine_element &input)
Given a point, return (if it exists) the 2 MultiTableId's that correspond to the LO_SCALAR,...
static MultiTable get_fixed_base_table(MultiTableId id)
Generate a multi-table that describes the lookups required to cover a fixed-base-scalar-mul of num_bi...
grumpkin::g1::element element
std::array< fixed_base_scalar_mul_tables, NUM_FIXED_BASE_MULTI_TABLES > all_multi_tables
static bool lookup_table_exists_for_point(const affine_element &input)
Given a point, do we have a precomputed lookup table for this point?
static constexpr uint256_t MAX_LO_SCALAR
static constexpr affine_element rhs_generator_point()
static single_lookup_table generate_single_lookup_table(const affine_element &base_point, const affine_element &offset_generator)
Given a base_point [P] and an offset_generator [G], compute a lookup table of MAX_TABLE_SIZE that con...
static fixed_base_scalar_mul_tables generate_tables(const affine_element &input)
For a given base point [P], compute the lookup tables required to traverse a num_bits sized lookup.
static const all_multi_tables & fixed_base_tables()
static affine_element lhs_base_point_lo()
static affine_element rhs_base_point_lo()
static const std::array< affine_element, table::NUM_FIXED_BASE_MULTI_TABLES > & fixed_base_table_offset_generators()
offset generators!
static affine_element lhs_base_point_hi()
static std::optional< affine_element > get_generator_offset_for_table_id(MultiTableId table_id)
Given a table id, return the offset generator term that will be present in the final scalar mul outpu...
static BasicTable generate_basic_fixed_base_table(BasicTableId id, size_t basic_table_index, size_t table_index)
Generate a single fixed-base-scalar-mul plookup table.
static constexpr affine_element lhs_generator_point()
std::vector< single_lookup_table > fixed_base_scalar_mul_tables
static std::array< bb::fr, 2 > get_basic_fixed_base_table_values(const std::array< uint64_t, 2 > key)
static affine_element rhs_base_point_hi()
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
A basic table from which we can perform lookups (for example, an xor table)
Parameters definitions for our fixed-base-scalar-multiplication lookup tables.
static constexpr size_t NUM_FIXED_BASE_MULTI_TABLES
static constexpr size_t BITS_PER_LO_SCALAR
Container for managing multiple BasicTables plus the data needed to combine basic table outputs (e....