#include <to_radix.hpp>
|
| | ToRadix (ExecutionIdManagerInterface &execution_id_manager, GreaterThanInterface >, EventEmitterInterface< ToRadixEvent > &event_emitter, EventEmitterInterface< ToRadixMemoryEvent > &memory_event_emitter) |
| |
| std::pair< std::vector< uint8_t >, bool > | to_le_radix (const FF &value, uint32_t num_limbs, uint32_t radix) override |
| | Performs a little endian radix decomposition of a field element into limbs. This emits a ToRadixEvent.
|
| |
| std::pair< std::vector< bool >, bool > | to_le_bits (const FF &value, uint32_t num_limbs) override |
| | Performs a little endian radix decomposition of a field element into bits. This emits a ToRadixEvent.
|
| |
| void | to_be_radix (MemoryInterface &memory, const FF &value, uint32_t radix, uint32_t num_limbs, bool is_output_bits, MemoryAddress dst_addr) override |
| | Performs a big endian radix decomposition of a field element into limbs. This directly emits a ToRadixMemoryEvent and indirectly emits a ToRadixEvent if no error different than truncation is encountered. The limbs are written to the memory in big endian order at the supplied destination address.
|
| |
| virtual | ~ToRadixInterface ()=default |
| |
Definition at line 18 of file to_radix.hpp.
◆ ToRadix()
◆ to_be_radix()
| void bb::avm2::simulation::ToRadix::to_be_radix |
( |
MemoryInterface & |
memory, |
|
|
const FF & |
value, |
|
|
uint32_t |
radix, |
|
|
uint32_t |
num_limbs, |
|
|
bool |
is_output_bits, |
|
|
MemoryAddress |
dst_addr |
|
) |
| |
|
overridevirtual |
Performs a big endian radix decomposition of a field element into limbs. This directly emits a ToRadixMemoryEvent and indirectly emits a ToRadixEvent if no error different than truncation is encountered. The limbs are written to the memory in big endian order at the supplied destination address.
- Exceptions
-
| ToRadixException | on input validation errors (checked first, all grouped):
- The destination memory slice is out-of-range (dst_addr + num_limbs > AVM_MEMORY_SIZE).
- Radix is less than 2.
- Radix is greater than 256.
- Radix is not 2 while is_output_bits is true.
- Num limbs is zero while value is not zero.
|
| ToRadixException | on truncation error (checked after input validation and decomposition):
- The value cannot be fully decomposed into the given number of limbs. Note that the supplied num_limbs can be greater than the number of limbs that the value decomposes into.
|
- Parameters
-
| memory | The memory to write the limbs to. |
| value | The field element to decompose. |
| radix | The radix to decompose into. Must be in the range [2, 256]. |
| num_limbs | The number of limbs to decompose into. |
| is_output_bits | A boolean indicating if the output is U1 or U8. |
| dst_addr | The address to write the limbs to. |
Implements bb::avm2::simulation::ToRadixInterface.
Definition at line 102 of file to_radix.cpp.
◆ to_le_bits()
| std::pair< std::vector< bool >, bool > bb::avm2::simulation::ToRadix::to_le_bits |
( |
const FF & |
value, |
|
|
uint32_t |
num_limbs |
|
) |
| |
|
overridevirtual |
Performs a little endian radix decomposition of a field element into bits. This emits a ToRadixEvent.
- Parameters
-
| value | The field element to decompose. |
| num_limbs | The number of bits to decompose into. |
- Returns
- A pair containing the vector of bits and a boolean indicating if the decomposition was truncated. The bits are converted in a standard way, i.e., from non-zero values to
true, zero to false.
Implements bb::avm2::simulation::ToRadixInterface.
Definition at line 67 of file to_radix.cpp.
◆ to_le_radix()
| std::pair< std::vector< uint8_t >, bool > bb::avm2::simulation::ToRadix::to_le_radix |
( |
const FF & |
value, |
|
|
uint32_t |
num_limbs, |
|
|
uint32_t |
radix |
|
) |
| |
|
overridevirtual |
Performs a little endian radix decomposition of a field element into limbs. This emits a ToRadixEvent.
- Note
- Asserts that radix is in range [2, 256].
- Parameters
-
| value | The field element to decompose. |
| num_limbs | The number of limbs to decompose into. |
| radix | The radix to decompose into. Must be in the range [2, 256]. |
- Returns
- A pair containing the vector of limbs and a boolean indicating if the decomposition was truncated.
Implements bb::avm2::simulation::ToRadixInterface.
Definition at line 22 of file to_radix.cpp.
◆ events
◆ execution_id_manager
◆ gt
◆ memory_events
The documentation for this class was generated from the following files: