Skip to main content

Module witness

Module witness 

Source
Expand description

Range check witness computation

Re-exportsยง

use alloc::boxed::Box; ๐Ÿ”’
use alloc::vec; ๐Ÿ”’
use alloc::vec; ๐Ÿ”’
use alloc::vec::Vec; ๐Ÿ”’
use ark_ff::PrimeField; ๐Ÿ”’
use core::array; ๐Ÿ”’
use num_bigint::BigUint; ๐Ÿ”’
use num_integer::Integer; ๐Ÿ”’
use o1_utils::field_helpers::BigUintFieldHelpers; ๐Ÿ”’
use o1_utils::FieldHelpers; ๐Ÿ”’
use o1_utils::ForeignElement; ๐Ÿ”’
use crate::circuits::polynomial::COLUMNS; ๐Ÿ”’
use crate::circuits::polynomials::foreign_field_common::BigUintForeignFieldHelpers; ๐Ÿ”’
use crate::circuits::polynomials::foreign_field_common::LIMB_BITS; ๐Ÿ”’
use crate::circuits::witness::init_row; ๐Ÿ”’
use crate::circuits::witness::CopyBitsCell; ๐Ÿ”’
use crate::circuits::witness::CopyCell; ๐Ÿ”’
use crate::circuits::witness::VariableCell; ๐Ÿ”’
use crate::circuits::witness::Variables; ๐Ÿ”’
use crate::circuits::witness::WitnessCell; ๐Ÿ”’
use crate::variable_map; ๐Ÿ”’
use crate::variables; ๐Ÿ”’

Functionsยง

create
Create a single range check witness Input: 88-bit value v0
create_multi
Create a multi range check witness from three 88-bit values: v0, v1 and v2
create_multi_compact
Create a multi range check witness from two limbs: v01 (176 bits), v2 (88 bits), where v2 is the most significant limb and v01 is the least significant limb
create_multi_compact_limbs
Create a multi range check witness from compact limbs
create_multi_limbs
Create a multi range check witness from limbs
extend
Extend an existing witness with a single range check witness for foreign field element
extend_multi
Extend an existing witness with a multi-range-check gadget for three 88-bit values: v0, v1 and v2
extend_multi_compact
Extend and existing witness with a multi range check witness for two limbs: v01 (176 bits), v2 (88 bits), where v2 is the most significant limb and v01 is the least significant limb
extend_multi_compact_limbs
Extend an existing witness with a multi-range-check gadget for compact limbs
extend_multi_from_fe
Extend an existing witness with a multi-range-check gadget for ForeignElement
extend_multi_limbs
Extend an existing witness with a multi-range-check gadget for limbs
extend_single
Extend an existing witness with a single-range-check gate for 88bits
layout ๐Ÿ”’
Witness layout
range_check_0_row
The row layout for RangeCheck0