Skip to content

Commit

Permalink
Remove unused PoK gadget
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed May 5, 2024
1 parent 5e50e98 commit 07729b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
8 changes: 4 additions & 4 deletions crypto/fcmps/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<C: Ciphersuite> Circuit<C> {
branch: Vec<Vec<Variable>>,
) {
let O = self.on_curve(curve, O);
let o_blind = self.discrete_log_pok(transcript, curve, o_blind);
let o_blind = self.discrete_log(transcript, curve, o_blind);
self.incomplete_add_pub(O_tilde, o_blind, O);

// This cannot simply be removed in order to cheat this proof
Expand All @@ -160,11 +160,11 @@ impl<C: Ciphersuite> Circuit<C> {
self.incomplete_add_pub(I_tilde, i_blind_u, I);

let i_blind_v = self.discrete_log(transcript, curve, i_blind_v);
let i_blind_blind = self.discrete_log_pok(transcript, curve, i_blind_blind);
let i_blind_blind = self.discrete_log(transcript, curve, i_blind_blind);
self.incomplete_add_pub(R, i_blind_v, i_blind_blind);

let C = self.on_curve(curve, C);
let c_blind = self.discrete_log_pok(transcript, curve, c_blind);
let c_blind = self.discrete_log(transcript, curve, c_blind);
self.incomplete_add_pub(C_tilde, c_blind, C);

self.permissible(C::F::ONE, C::F::ONE, O.y);
Expand All @@ -181,7 +181,7 @@ impl<C: Ciphersuite> Circuit<C> {
hash: (Variable, Variable),
branch: Vec<Variable>,
) {
let blind = self.discrete_log_pok(transcript, curve, blind);
let blind = self.discrete_log(transcript, curve, blind);
let hash = self.on_curve(curve, hash);
self.incomplete_add_pub(blinded_hash, blind, hash);
self.permissible(C::F::ONE, C::F::ONE, hash.y);
Expand Down
19 changes: 0 additions & 19 deletions crypto/fcmps/src/gadgets/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,4 @@ impl<C: Ciphersuite> Circuit<C> {

point
}

/// Prove knowledge of the discrete logarithm for the specified point over the specified
/// generator.
///
/// The variable used as knowledge of the discrete log representation must be treated as a
/// non-canonical, opaque black box which is inconsistent across uses (and accordingly unsafe to
/// reuse).
///
/// Ensures the point is on-curve.
pub(crate) fn discrete_log_pok<T: Transcript>(
&mut self,
transcript: &mut T,
curve: &CurveSpec<C::F>,
claim: ClaimedPointWithDlog<C::F>,
) -> OnCurve {
// For now, we use the more expensive Discrete Log instead of attempting any more optimized
// versions of this gadget
self.discrete_log(transcript, curve, claim)
}
}

0 comments on commit 07729b3

Please sign in to comment.