Skip to content

Commit

Permalink
plonk: modified plonk_verifier<ppT>::step_four() to directly pass the…
Browse files Browse the repository at this point in the history
… input parameter transcript_hash to the constructor instead of first copying and then moving.
  • Loading branch information
Vesselin Velichkov committed Jul 13, 2022
1 parent 3cc3f95 commit b1c76fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion libsnark/zk_proof_systems/plonk/verifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ template<typename ppT> class plonk_verifier
/// \param[out] u: multipoint evaluation challenge - hash of
/// transcript
static step_four_out_t<ppT> step_four(
transcript_hash_t<ppT> &transcript_hash);
const transcript_hash_t<ppT> &transcript_hash);

/// Verifier Step 5: compute zero polynomial evaluation
///
Expand Down
28 changes: 7 additions & 21 deletions libsnark/zk_proof_systems/plonk/verifier.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,16 @@ step_four_out_t<ppT>::step_four_out_t(
/// transcript
template<typename ppT>
step_four_out_t<ppT> plonk_verifier<ppT>::step_four(
transcript_hash_t<ppT> &transcript_hash)
const transcript_hash_t<ppT> &transcript_hash)
{
// step 4 output
libff::Fr<ppT> beta;
libff::Fr<ppT> gamma;
libff::Fr<ppT> alpha;
libff::Fr<ppT> zeta;
libff::Fr<ppT> nu;
libff::Fr<ppT> u;

beta = transcript_hash.beta;
gamma = transcript_hash.gamma;
alpha = transcript_hash.alpha;
zeta = transcript_hash.zeta;
nu = transcript_hash.nu;
u = transcript_hash.u;

step_four_out_t<ppT> step_four_out(
std::move(beta),
std::move(gamma),
std::move(alpha),
std::move(zeta),
std::move(nu),
std::move(u));
Field(transcript_hash.beta),
Field(transcript_hash.gamma),
Field(transcript_hash.alpha),
Field(transcript_hash.zeta),
Field(transcript_hash.nu),
Field(transcript_hash.u));

return step_four_out;
}
Expand Down

0 comments on commit b1c76fc

Please sign in to comment.