Skip to content

Commit

Permalink
rename uint_new back to uint
Browse files Browse the repository at this point in the history
  • Loading branch information
iammadab committed Jul 12, 2024
1 parent a349701 commit 189ad7f
Show file tree
Hide file tree
Showing 30 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion singer-pro/src/basic_block/bb_final.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use gkr::structs::Circuit;
use itertools::Itertools;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
GlobalStateChipOperations, OAMOperations, ROMOperations, RangeChipOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer-pro/src/basic_block/bb_start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
GlobalStateChipOperations, OAMOperations, ROMOperations, RangeChipOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer-pro/src/instructions/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::CircuitBuilder;
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::ROMOperations,
chips::IntoEnumIterator,
Expand Down
2 changes: 1 addition & 1 deletion singer-pro/src/instructions/gt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::CircuitBuilder;
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::ROMOperations,
chips::IntoEnumIterator,
Expand Down
2 changes: 1 addition & 1 deletion singer-pro/src/instructions/mstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use singer_utils::{
constants::{OpcodeType, EVM_STACK_BYTE_WIDTH},
register_witness,
structs::{ChipChallenges, InstOutChipType, RAMHandler, ROMHandler, StackUInt, TSUInt},
uint_new::constants::AddSubConstants,
uint::constants::AddSubConstants,
};
use std::{mem, sync::Arc};

Expand Down
2 changes: 1 addition & 1 deletion singer-pro/src/instructions/ret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use gkr::structs::Circuit;
use gkr_graph::structs::{CircuitGraphBuilder, NodeOutputType, PredType};
use paste::paste;
use simple_frontend::structs::CircuitBuilder;
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{OAMOperations, ROMOperations},
chips::{IntoEnumIterator, SingerChipBuilder},
Expand Down
2 changes: 1 addition & 1 deletion singer-utils/src/chip_handler.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ff_ext::ExtensionField;
use simple_frontend::structs::{CellId, ChallengeId, CircuitBuilder, MixedCell, WitnessId};

use crate::{constants::OpcodeType, error::UtilError, structs::ChipChallenges, uint_new::UInt};
use crate::{constants::OpcodeType, error::UtilError, structs::ChipChallenges, uint::UInt};

pub mod bytecode;
pub mod calldata;
Expand Down
2 changes: 1 addition & 1 deletion singer-utils/src/chip_handler/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
constants::{RANGE_CHIP_BIT_WIDTH, STACK_TOP_BIT_WIDTH},
error::UtilError,
structs::{PCUInt, ROMHandler, TSUInt},
uint_new::UInt,
uint::UInt,
};

use super::{ROMOperations, RangeChipOperations};
Expand Down
2 changes: 1 addition & 1 deletion singer-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub mod chips;
pub mod constants;
pub mod error;
pub mod structs;
pub mod uint_new;
pub mod uint;

#[macro_use]
pub mod macros;
4 changes: 2 additions & 2 deletions singer-utils/src/structs.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use ff_ext::ExtensionField;
use simple_frontend::structs::{CellId, ChallengeId, ExtCellId};
use strum_macros::EnumIter;
use uint_new::UInt;
use uint::UInt;

use crate::constants::{EVM_STACK_BIT_WIDTH, VALUE_BIT_WIDTH};
use crate::uint_new;
use crate::uint;

#[derive(Clone, Debug, Copy, EnumIter)]
pub enum RAMType {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{chip_handler::RangeChipOperations, error::UtilError, uint_new::uint::UInt};
use crate::{chip_handler::RangeChipOperations, error::UtilError, uint::uint::UInt};
use ff::Field;
use ff_ext::ExtensionField;
use simple_frontend::structs::{Cell, CellId, CircuitBuilder};
Expand Down Expand Up @@ -292,7 +292,7 @@ impl<const M: usize, const C: usize> UInt<M, C> {

#[cfg(test)]
mod tests {
use crate::uint_new::{constants::AddSubConstants, UInt};
use crate::uint::{constants::AddSubConstants, UInt};
use gkr::structs::{Circuit, CircuitWitness};
use goldilocks::{Goldilocks, GoldilocksExt2};
use itertools::Itertools;
Expand Down Expand Up @@ -328,8 +328,8 @@ mod tests {
let (carry_id, carry_cells) =
circuit_builder.create_witness_in(AddSubConstants::<UInt20>::N_CARRY_CELLS);

let addend_0 = UInt20::try_from(addend_0_cells).expect("should build uint_new");
let addend_1 = UInt20::try_from(addend_1_cells).expect("should build uint_new");
let addend_0 = UInt20::try_from(addend_0_cells).expect("should build uint");
let addend_1 = UInt20::try_from(addend_1_cells).expect("should build uint");

// update circuit builder with circuit instructions
let result =
Expand Down Expand Up @@ -403,7 +403,7 @@ mod tests {
let (carry_id, carry_cells) =
circuit_builder.create_witness_in(AddSubConstants::<UInt20>::N_CARRY_CELLS);

let addend_0 = UInt20::try_from(addend_0_cells).expect("should build uint_new");
let addend_0 = UInt20::try_from(addend_0_cells).expect("should build uint");

// update circuit builder
let result = UInt20::add_const_unsafe(
Expand Down Expand Up @@ -477,7 +477,7 @@ mod tests {
let (carry_id, carry_cells) =
circuit_builder.create_witness_in(AddSubConstants::<UInt20>::N_CARRY_CELLS);

let addend_0 = UInt20::try_from(addend_0_cells).expect("should build uint_new");
let addend_0 = UInt20::try_from(addend_0_cells).expect("should build uint");

// update circuit builder
let result = UInt20::add_cell_unsafe(
Expand Down Expand Up @@ -555,8 +555,8 @@ mod tests {
let (borrow_id, borrow_cells) =
circuit_builder.create_witness_in(AddSubConstants::<UInt20>::N_CARRY_CELLS);

let minuend = UInt20::try_from(minuend_cells).expect("should build uint_new");
let subtrahend = UInt20::try_from(subtrahend_cells).expect("should build uint_new");
let minuend = UInt20::try_from(minuend_cells).expect("should build uint");
let subtrahend = UInt20::try_from(subtrahend_cells).expect("should build uint");

// update the circuit builder
let result =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
chip_handler::RangeChipOperations,
error::UtilError,
uint_new::{constants::AddSubConstants, uint::UInt},
uint::{constants::AddSubConstants, uint::UInt},
};
use ff::Field;
use ff_ext::ExtensionField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::uint::UInt;
use crate::constants::RANGE_CHIP_BIT_WIDTH;
use crate::uint_new::util::const_min;
use crate::uint::util::const_min;
use std::marker::PhantomData;

impl<const M: usize, const C: usize> UInt<M, C> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
constants::{BYTE_BIT_WIDTH, RANGE_CHIP_BIT_WIDTH},
error::UtilError,
uint_new::util::{add_one_to_big_num, convert_decomp, pad_cells},
uint::util::{add_one_to_big_num, convert_decomp, pad_cells},
};
use ff_ext::ExtensionField;
use goldilocks::SmallField;
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<const M: usize, const C: usize> TryFrom<&[CellId]> for UInt<M, C> {

#[cfg(test)]
mod tests {
use crate::uint_new::uint::UInt;
use crate::uint::uint::UInt;
use gkr::structs::{Circuit, CircuitWitness};
use goldilocks::{Goldilocks, GoldilocksExt2};
use itertools::Itertools;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn add_one_to_big_num<F: SmallField>(limb_modulo: F, limbs: &[F]) -> Vec<F>

#[cfg(test)]
mod tests {
use crate::uint_new::util::{add_one_to_big_num, const_min, convert_decomp, pad_cells};
use crate::uint::util::{add_one_to_big_num, const_min, convert_decomp, pad_cells};
use gkr::structs::{Circuit, CircuitWitness};
use goldilocks::{Goldilocks, GoldilocksExt2};
use itertools::Itertools;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::uint_new::constants::AddSubConstants;
use crate::uint_new::uint::UInt;
use crate::uint::constants::AddSubConstants;
use crate::uint::uint::UInt;
use simple_frontend::structs::CellId;

// TODO: split this into different impls, constrained by specific contexts
Expand Down
4 changes: 2 additions & 2 deletions singer/src/instructions/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use singer_utils::{
constants::OpcodeType,
register_witness,
structs::{PCUInt, RAMHandler, ROMHandler, StackUInt, TSUInt},
uint_new::constants::AddSubConstants,
uint::constants::AddSubConstants,
};
use std::sync::Arc;

Expand Down Expand Up @@ -190,7 +190,7 @@ mod test {
use singer_utils::{
constants::RANGE_CHIP_BIT_WIDTH,
structs::{StackUInt, TSUInt},
uint_new::constants::AddSubConstants,
uint::constants::AddSubConstants,
};
use std::{collections::BTreeMap, time::Instant};
use transcript::Transcript;
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/calldataload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, CalldataChipOperations, GlobalStateChipOperations, OAMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/dup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/gt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/jump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/jumpdest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/jumpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use singer_utils::{
constants::OpcodeType,
register_witness,
structs::{PCUInt, RAMHandler, ROMHandler, StackUInt, TSUInt},
uint_new::constants::AddSubConstants,
uint::constants::AddSubConstants,
};
use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/mstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use singer_utils::{
constants::{OpcodeType, EVM_STACK_BYTE_WIDTH},
register_witness,
structs::{PCUInt, RAMHandler, ROMHandler, StackUInt, TSUInt},
uint_new::constants::AddSubConstants,
uint::constants::AddSubConstants,
};
use std::{mem, sync::Arc};

Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/pop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/ret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use gkr::structs::Circuit;
use gkr_graph::structs::{CircuitGraphBuilder, NodeOutputType, PredType};
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/instructions/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ff_ext::ExtensionField;
use gkr::structs::Circuit;
use paste::paste;
use simple_frontend::structs::{CircuitBuilder, MixedCell};
use singer_utils::uint_new::constants::AddSubConstants;
use singer_utils::uint::constants::AddSubConstants;
use singer_utils::{
chip_handler::{
BytecodeChipOperations, GlobalStateChipOperations, OAMOperations, ROMOperations,
Expand Down
2 changes: 1 addition & 1 deletion singer/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use gkr::utils::MultilinearExtensionFromVectors;
use goldilocks::SmallField;
use itertools::Itertools;
use simple_frontend::structs::CellId;
use singer_utils::uint_new::UInt;
use singer_utils::uint::UInt;
use std::collections::BTreeMap;

use crate::instructions::InstCircuit;
Expand Down

0 comments on commit 189ad7f

Please sign in to comment.