|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
straus_scalar_slices decomposes an input scalar into bit-slices of size table_bits. Used in batch_mul, which implements the Straus multiscalar multiplication algorithm.
More...
#include <straus_scalar_slice.hpp>
Public Types | |
| using | field_t = stdlib::field_t< Builder > |
Public Member Functions | |
| straus_scalar_slices (Builder *context, const cycle_scalar< Builder > &scalars, size_t table_bits) | |
| Construct straus_scalar_slices from an input cycle_scalar and specified table_bits. | |
| field_t | operator[] (size_t index) |
Return a bit-slice associated with round index. | |
Public Attributes | |
| size_t | _table_bits |
| std::vector< field_t > | slices |
| std::vector< uint64_t > | slices_native |
Static Private Member Functions | |
| static std::pair< std::vector< field_t >, std::vector< uint64_t > > | compute_scalar_slices (Builder *context, const field_t &scalar, size_t num_bits, size_t table_bits) |
| Convert an input cycle_scalar field element into a vector of bit-slices. | |
straus_scalar_slices decomposes an input scalar into bit-slices of size table_bits. Used in batch_mul, which implements the Straus multiscalar multiplication algorithm.
Definition at line 24 of file straus_scalar_slice.hpp.
| using bb::stdlib::straus_scalar_slices< Builder >::field_t = stdlib::field_t<Builder> |
Definition at line 26 of file straus_scalar_slice.hpp.
| bb::stdlib::straus_scalar_slices< Builder >::straus_scalar_slices | ( | Builder * | context, |
| const cycle_scalar< Builder > & | scalar, | ||
| size_t | table_bits | ||
| ) |
Construct straus_scalar_slices from an input cycle_scalar and specified table_bits.
Performs an in-circuit decomposition of the input cycle_scalar into bit-slices of size table_bits.
| Builder |
| context | |
| scalar | |
| table_bits |
Definition at line 82 of file straus_scalar_slice.cpp.
|
staticprivate |
Convert an input cycle_scalar field element into a vector of bit-slices.
Each slice contains table_bits bits. Also performs an implicit range check on the input slices via decompose_into_default_range
| Builder |
| context | The circuit builder |
| scalar | The field element to decompose |
| num_bits | Number of bits in the scalar |
| table_bits | Number of bits per slice |
Definition at line 28 of file straus_scalar_slice.cpp.
| field_t< Builder > bb::stdlib::straus_scalar_slices< Builder >::operator[] | ( | size_t | index | ) |
Return a bit-slice associated with round index.
In Straus algorithm, index is a known parameter, so no need for expensive lookup tables
| Builder |
| index |
Definition at line 114 of file straus_scalar_slice.cpp.
| size_t bb::stdlib::straus_scalar_slices< Builder >::_table_bits |
Definition at line 30 of file straus_scalar_slice.hpp.
| std::vector<field_t> bb::stdlib::straus_scalar_slices< Builder >::slices |
Definition at line 31 of file straus_scalar_slice.hpp.
| std::vector<uint64_t> bb::stdlib::straus_scalar_slices< Builder >::slices_native |
Definition at line 32 of file straus_scalar_slice.hpp.