Barretenberg
The ZK-SNARK library at the core of Aztec
|
straus_scalar_slice decomposes an input scalar into table_bits
bit-slices. Used in batch_mul
, which ses 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_slice (Builder *context, const cycle_scalar< Builder > &scalars, size_t table_bits) | |
Construct a new straus scalar slice::straus scalar slice object. | |
std::optional< field_t > | read (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 |
straus_scalar_slice decomposes an input scalar into table_bits
bit-slices. Used in batch_mul
, which ses the Straus multiscalar multiplication algorithm.
Definition at line 24 of file straus_scalar_slice.hpp.
using bb::stdlib::straus_scalar_slice< Builder >::field_t = stdlib::field_t<Builder> |
Definition at line 26 of file straus_scalar_slice.hpp.
bb::stdlib::straus_scalar_slice< Builder >::straus_scalar_slice | ( | Builder * | context, |
const cycle_scalar< Builder > & | scalar, | ||
size_t | table_bits | ||
) |
Construct a new straus scalar slice::straus scalar slice object.
As part of slicing algoirthm, we also perform a primality test on the inut scalar.
TODO(@zac-williamson) make the primality test configurable. We may want to validate the input < BN254::Fr OR input < Grumpkin::Fr depending on context!
Builder |
context | |
scalar | |
table_bits |
Definition at line 28 of file straus_scalar_slice.cpp.
std::optional< field_t< Builder > > bb::stdlib::straus_scalar_slice< Builder >::read | ( | 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 130 of file straus_scalar_slice.cpp.
size_t bb::stdlib::straus_scalar_slice< Builder >::_table_bits |
Definition at line 30 of file straus_scalar_slice.hpp.
std::vector<field_t> bb::stdlib::straus_scalar_slice< Builder >::slices |
Definition at line 31 of file straus_scalar_slice.hpp.
std::vector<uint64_t> bb::stdlib::straus_scalar_slice< Builder >::slices_native |
Definition at line 32 of file straus_scalar_slice.hpp.