Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenfeizhang committed Dec 9, 2024
1 parent f1fb7a5 commit 4349cba
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion expander_compiler/src/frontend/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub trait BasicAPI<C: Config> {
binary_op!(xor);
binary_op!(or);
binary_op!(and);

fn display(&self, _x: impl ToVariableOrValue<C::CircuitField>) {}
fn div(
&mut self,
Expand Down
2 changes: 2 additions & 0 deletions rsa_circuit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions rsa_circuit/src/tests/u2048_mul_no_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions rsa_circuit/src/u120.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use expander_compiler::frontend::{
extra::UnconstrainedAPI, BN254Config, BasicAPI, RootAPI, Variable, API,
};
use expander_compiler::frontend::{BN254Config, RootAPI, Variable};

#[inline]
// TODO:
Expand Down
8 changes: 3 additions & 5 deletions rsa_circuit/src/u2048.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions rsa_circuit/src/util.rs
Original file line number Diff line number Diff line change
@@ -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<Builder: RootAPI<BN254Config>>(
Expand Down

0 comments on commit 4349cba

Please sign in to comment.