|
| static field_pt | create_logic_constraint (field_pt &a, field_pt &b, size_t num_bits, bool is_xor_gate, const std::function< std::pair< uint256_t, uint256_t >(uint256_t, uint256_t, size_t)> &get_chunk=[](uint256_t left, uint256_t right, size_t chunk_size) { uint256_t left_chunk=left &((uint256_t(1)<< chunk_size) - 1);uint256_t right_chunk=right &((uint256_t(1)<< chunk_size) - 1);return std::make_pair(left_chunk, right_chunk);}) |
| | A logical AND or XOR over a variable number of bits.
|
| |
◆ create_logic_constraint()
| field_t< Builder > proof_system::plonk::stdlib::logic< Builder >::create_logic_constraint |
( |
field_pt & |
a, |
|
|
field_pt & |
b, |
|
|
size_t |
num_bits, |
|
|
bool |
is_xor_gate, |
|
|
const std::function< std::pair< uint256_t, uint256_t >(uint256_t, uint256_t, size_t)> & |
get_chunk = [](uint256_t left, uint256_t right, size_t chunk_size) { uint256_t left_chunk = left & ((uint256_t(1) << chunk_size) - 1); uint256_t right_chunk = right & ((uint256_t(1) << chunk_size) - 1); return std::make_pair(left_chunk, right_chunk); } |
|
) |
| |
|
static |
A logical AND or XOR over a variable number of bits.
Defaults to basic Builder method if not using plookup-compatible builder. If the left and right operands are larger than num_bit, the result will be truncated to num_bits. However, the two operands could be range-constrained to num_bits before the call, which would remove the need to range constrain inside this function.
- Template Parameters
-
- Parameters
-
- Returns
- field_t<Builder>
The documentation for this class was generated from the following files:
- src/barretenberg/stdlib/primitives/logic/logic.hpp
- src/barretenberg/stdlib/primitives/logic/logic.cpp