Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::plookup::FixedBaseParams Struct Reference

Parameters definitions for our fixed-base-scalar-multiplication lookup tables. More...

#include <fixed_base_params.hpp>

Inheritance diagram for bb::plookup::FixedBaseParams:
bb::plookup::fixed_base::table

Static Public Member Functions

template<size_t multitable_index>
static constexpr size_t get_num_bits_of_multi_table ()
 Returns the number of scalar mul bits we are traversing in multitable with the given index.
 

Static Public Attributes

static constexpr size_t BITS_PER_TABLE = 9
 
static constexpr size_t BITS_ON_CURVE = 254
 
static constexpr size_t BITS_PER_LO_SCALAR = 128
 
static constexpr size_t BITS_PER_HI_SCALAR = BITS_ON_CURVE - BITS_PER_LO_SCALAR
 
static constexpr size_t MAX_TABLE_SIZE = (1UL) << BITS_PER_TABLE
 
static constexpr size_t NUM_FIXED_BASE_MULTI_TABLES = 4
 
static constexpr size_t NUM_TABLES_PER_LO_MULTITABLE = numeric::ceil_div(BITS_PER_LO_SCALAR, BITS_PER_TABLE)
 
static constexpr size_t NUM_TABLES_PER_HI_MULTITABLE = numeric::ceil_div(BITS_PER_HI_SCALAR, BITS_PER_TABLE)
 
static constexpr size_t MAX_NUM_TABLES_IN_MULTITABLE
 
static const bb::fr COLUMN_2_STEP_SIZE = bb::fr(0)
 
static const bb::fr COLUMN_3_STEP_SIZE = bb::fr(0)
 

Detailed Description

Parameters definitions for our fixed-base-scalar-multiplication lookup tables.

We split each 254-bit scalar mul into two scalar muls of size BITS_PER_LO_SCALAR, BITS_PER_HI_SCALAR. This enables us to efficiently decompose our input scalar multiplier into two chunks of a known size (i.e. we get free BITS_PER_LO_SCALAR, BITS_PER_HI_SCALAR range checks as part of the lookup table subroutine). This in turn allows us to perform a primality test more efficiently, i.e. check that input scalar < prime modulus when evaluated over the integers. (The primality check requires us to split the input into high / low bit chunks so getting this for free as part of the lookup algorithm is nice!).

Definition at line 26 of file fixed_base_params.hpp.

Member Function Documentation

◆ get_num_bits_of_multi_table()

template<size_t multitable_index>
static constexpr size_t bb::plookup::FixedBaseParams::get_num_bits_of_multi_table ( )
inlinestaticconstexpr

Returns the number of scalar mul bits we are traversing in multitable with the given index.

Parameters
multitable_indexRanges from 0 to NUM_FIXED_BASE_MULTI_TABLES - 1
Returns
constexpr size_t

Definition at line 54 of file fixed_base_params.hpp.

Member Data Documentation

◆ BITS_ON_CURVE

constexpr size_t bb::plookup::FixedBaseParams::BITS_ON_CURVE = 254
staticconstexpr

Definition at line 28 of file fixed_base_params.hpp.

◆ BITS_PER_HI_SCALAR

constexpr size_t bb::plookup::FixedBaseParams::BITS_PER_HI_SCALAR = BITS_ON_CURVE - BITS_PER_LO_SCALAR
staticconstexpr

Definition at line 31 of file fixed_base_params.hpp.

◆ BITS_PER_LO_SCALAR

constexpr size_t bb::plookup::FixedBaseParams::BITS_PER_LO_SCALAR = 128
staticconstexpr

Definition at line 30 of file fixed_base_params.hpp.

◆ BITS_PER_TABLE

constexpr size_t bb::plookup::FixedBaseParams::BITS_PER_TABLE = 9
staticconstexpr

Definition at line 27 of file fixed_base_params.hpp.

◆ COLUMN_2_STEP_SIZE

const bb::fr bb::plookup::FixedBaseParams::COLUMN_2_STEP_SIZE = bb::fr(0)
inlinestatic

Definition at line 45 of file fixed_base_params.hpp.

◆ COLUMN_3_STEP_SIZE

const bb::fr bb::plookup::FixedBaseParams::COLUMN_3_STEP_SIZE = bb::fr(0)
inlinestatic

Definition at line 46 of file fixed_base_params.hpp.

◆ MAX_NUM_TABLES_IN_MULTITABLE

constexpr size_t bb::plookup::FixedBaseParams::MAX_NUM_TABLES_IN_MULTITABLE
staticconstexpr
Initial value:
=
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
static constexpr size_t NUM_TABLES_PER_HI_MULTITABLE
static constexpr size_t NUM_TABLES_PER_LO_MULTITABLE

Definition at line 39 of file fixed_base_params.hpp.

◆ MAX_TABLE_SIZE

constexpr size_t bb::plookup::FixedBaseParams::MAX_TABLE_SIZE = (1UL) << BITS_PER_TABLE
staticconstexpr

Definition at line 34 of file fixed_base_params.hpp.

◆ NUM_FIXED_BASE_MULTI_TABLES

constexpr size_t bb::plookup::FixedBaseParams::NUM_FIXED_BASE_MULTI_TABLES = 4
staticconstexpr

Definition at line 36 of file fixed_base_params.hpp.

◆ NUM_TABLES_PER_HI_MULTITABLE

constexpr size_t bb::plookup::FixedBaseParams::NUM_TABLES_PER_HI_MULTITABLE = numeric::ceil_div(BITS_PER_HI_SCALAR, BITS_PER_TABLE)
staticconstexpr

Definition at line 38 of file fixed_base_params.hpp.

◆ NUM_TABLES_PER_LO_MULTITABLE

constexpr size_t bb::plookup::FixedBaseParams::NUM_TABLES_PER_LO_MULTITABLE = numeric::ceil_div(BITS_PER_LO_SCALAR, BITS_PER_TABLE)
staticconstexpr

Definition at line 37 of file fixed_base_params.hpp.


The documentation for this struct was generated from the following file: