Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <logic.hpp>
Public Types | |
using | field_pt = field_t< Builder > |
using | witness_pt = witness_t< Builder > |
Static Public Member Functions | |
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. | |
using bb::stdlib::logic< Builder >::field_pt = field_t<Builder> |
using bb::stdlib::logic< Builder >::witness_pt = witness_t<Builder> |
|
static |
A logical AND or XOR over a variable number of bits.
If the left and right operands are larger than num_bits, 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.
Builder |
a | |
b | |
num_bits | |
is_xor_gate |