Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Commit

Permalink
chore: clean some parts
Browse files Browse the repository at this point in the history
  • Loading branch information
duguorong009 committed Oct 24, 2023
1 parent 686e7f0 commit 02566be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
7 changes: 3 additions & 4 deletions eigentrust-zk/src/ecdsa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ where

let x_candidate = r_point.x;

// let new_x_int = Integer::<C::Base, N, NUM_LIMBS, NUM_BITS, P>::from_limbs(x_candidate.limbs);
let new_x = AssignedInteger::new(x_candidate.integer, x_candidate.limbs);
let reducer = IntegerReduceChip::new(new_x);
let reduced_x = reducer.synthesize(
Expand All @@ -463,10 +462,10 @@ where

let new_r: Integer<C::Base, N, NUM_LIMBS, NUM_BITS, P> =
Integer::new(self.signature.r.integer.value());
let r_integer = ConstIntegerAssigner::new(new_r);
let r_integer = r_integer.synthesize(common, &(), layouter.namespace(|| "r"))?;
let sig_r = ConstIntegerAssigner::new(new_r);
let sig_r = sig_r.synthesize(common, &(), layouter.namespace(|| "r"))?;

let ecc_eq_chipset = IntegerEqualChipset::new(reduced_x, r_integer);
let ecc_eq_chipset = IntegerEqualChipset::new(reduced_x, sig_r);
let is_eq = ecc_eq_chipset.synthesize(
common,
&config.int_eq,
Expand Down
10 changes: 2 additions & 8 deletions eigentrust-zk/src/gadgets/bits2num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ impl<F: FieldExt> Bits2NumChip<F> {
pub fn new_exact<const B: usize>(value: AssignedCell<F, F>) -> Self {
let fe = assigned_to_field(value.clone());
let bit_vals = match fe {
Some(fe) => {
let bits = field_to_bits::<_, B>(fe);
bits.map(|x| Value::known(x)).to_vec()
},
None => {
let bits = field_to_bits::<_, B>(F::ZERO);
bits.map(|_| Value::unknown()).to_vec()
},
Some(fe) => field_to_bits::<_, B>(fe).map(|x| Value::known(x)).to_vec(),
None => field_to_bits::<_, B>(F::ZERO).map(|_| Value::unknown()).to_vec(),
};
Self { value, bits: bit_vals }
}
Expand Down
5 changes: 0 additions & 5 deletions eigentrust-zk/src/verifier/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,6 @@ where
/// This method tests for `self` and `other` values to be equal, and is
/// used by `==`.
fn eq(&self, other: &Self) -> bool {
// let lhs = assigned_to_field(self.inner.clone());
// let rhs = assigned_to_field(other.inner.clone());

// lhs == rhs

self.index == other.index
}
}
Expand Down

0 comments on commit 02566be

Please sign in to comment.