Skip to main content

Module and

Module and 

Source
Expand description

This module includes the AND gadget implementation and the witness creation code. Note that this module does not need any new gate type for the AND operation.

Re-exportsยง

use alloc::vec; ๐Ÿ”’
use alloc::vec; ๐Ÿ”’
use alloc::vec::Vec; ๐Ÿ”’
use core::array; ๐Ÿ”’
use super::generic::GenericGateSpec; ๐Ÿ”’
use super::xor::init_xor; ๐Ÿ”’
use super::xor::num_xors; ๐Ÿ”’
use crate::circuits::gate::CircuitGate; ๐Ÿ”’
use crate::circuits::gate::Connect; ๐Ÿ”’
use crate::circuits::lookup; ๐Ÿ”’
use crate::circuits::lookup::tables::GateLookupTable; ๐Ÿ”’
use crate::circuits::lookup::tables::LookupTable; ๐Ÿ”’
use crate::circuits::polynomial::COLUMNS; ๐Ÿ”’
use crate::circuits::wires::Wire; ๐Ÿ”’
use ark_ff::PrimeField; ๐Ÿ”’
use num_bigint::BigUint; ๐Ÿ”’
use o1_utils::BigUintFieldHelpers; ๐Ÿ”’
use o1_utils::BigUintHelpers; ๐Ÿ”’
use o1_utils::BitwiseOps; ๐Ÿ”’
use o1_utils::FieldHelpers; ๐Ÿ”’
use o1_utils::Two; ๐Ÿ”’

Functionsยง

create_and_witness
Create a And for inputs as field elements starting at row 0 Input: first input, second input, and desired byte length Panics if the input is too large for the chosen number of bytes
extend_and_witness
Extends an AND witness to the whole witness Input: first input, second input, and desired byte length Panics if the input is too large for the chosen number of bytes
lookup_table
Get the AND lookup table