From 4349cba812f20408a7fe1ec5a7218383eac4b889 Mon Sep 17 00:00:00 2001 From: zhenfei Date: Mon, 9 Dec 2024 17:25:38 -0500 Subject: [PATCH] clean up --- expander_compiler/src/frontend/api.rs | 2 +- rsa_circuit/src/lib.rs | 2 ++ rsa_circuit/src/tests/u2048_mul_no_mod.rs | 4 ++-- rsa_circuit/src/u120.rs | 4 +--- rsa_circuit/src/u2048.rs | 8 +++----- rsa_circuit/src/util.rs | 3 +-- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/expander_compiler/src/frontend/api.rs b/expander_compiler/src/frontend/api.rs index 071e7d7..1277620 100644 --- a/expander_compiler/src/frontend/api.rs +++ b/expander_compiler/src/frontend/api.rs @@ -19,7 +19,7 @@ pub trait BasicAPI { binary_op!(xor); binary_op!(or); binary_op!(and); - + fn display(&self, _x: impl ToVariableOrValue) {} fn div( &mut self, diff --git a/rsa_circuit/src/lib.rs b/rsa_circuit/src/lib.rs index 08d48d2..317c040 100644 --- a/rsa_circuit/src/lib.rs +++ b/rsa_circuit/src/lib.rs @@ -5,11 +5,13 @@ mod native; pub use native::*; mod u120; +pub use u120::*; mod u2048; pub use u2048::*; mod util; +pub use util::*; #[cfg(test)] mod tests; diff --git a/rsa_circuit/src/tests/u2048_mul_no_mod.rs b/rsa_circuit/src/tests/u2048_mul_no_mod.rs index 1d2ea81..0505125 100644 --- a/rsa_circuit/src/tests/u2048_mul_no_mod.rs +++ b/rsa_circuit/src/tests/u2048_mul_no_mod.rs @@ -3,9 +3,9 @@ use std::mem::transmute; use expander_compiler::frontend::*; use expander_compiler::{ declare_circuit, - frontend::{BN254Config, Define, Variable, API}, + frontend::{BN254Config, Variable}, }; -use extra::{debug_eval, DebugAPI}; +use extra::debug_eval; use halo2curves::bn256::Fr; use num_bigint::BigUint; use num_traits::Num; diff --git a/rsa_circuit/src/u120.rs b/rsa_circuit/src/u120.rs index 1a3dc5c..4fee979 100644 --- a/rsa_circuit/src/u120.rs +++ b/rsa_circuit/src/u120.rs @@ -1,6 +1,4 @@ -use expander_compiler::frontend::{ - extra::UnconstrainedAPI, BN254Config, BasicAPI, RootAPI, Variable, API, -}; +use expander_compiler::frontend::{BN254Config, RootAPI, Variable}; #[inline] // TODO: diff --git a/rsa_circuit/src/u2048.rs b/rsa_circuit/src/u2048.rs index 953dc97..b50e3a5 100644 --- a/rsa_circuit/src/u2048.rs +++ b/rsa_circuit/src/u2048.rs @@ -1,6 +1,4 @@ -use expander_compiler::frontend::{ - extra::UnconstrainedAPI, BN254Config, BasicAPI, RootAPI, Variable, API, -}; +use expander_compiler::frontend::{BN254Config, RootAPI, Variable}; use crate::{ constants::N_LIMBS, @@ -268,8 +266,8 @@ impl U2048Variable { ); local_res[target_position] = sum; - addition_carries[target_position+1] = - builder.add(addition_carries[target_position+1], new_carry); + addition_carries[target_position + 1] = + builder.add(addition_carries[target_position + 1], new_carry); // update mul_carry to result[target+1] let (sum, new_carry) = add_u120( diff --git a/rsa_circuit/src/util.rs b/rsa_circuit/src/util.rs index 76d9c76..88a4f00 100644 --- a/rsa_circuit/src/util.rs +++ b/rsa_circuit/src/util.rs @@ -1,6 +1,5 @@ use expander_compiler::frontend::*; -use expander_compiler::frontend::{BN254Config, Variable, API}; -use extra::UnconstrainedAPI; +use expander_compiler::frontend::{BN254Config, Variable}; use halo2curves::bn256::Fr; pub(crate) fn unconstrained_byte_decomposition>(