@@ -101,6 +101,7 @@ std::ostream& operator<<(std::ostream &out, const r1cs_se_ppzksnark_verification
101101 out << vk.H_beta << OUTPUT_NEWLINE;
102102 out << vk.G_gamma << OUTPUT_NEWLINE;
103103 out << vk.H_gamma << OUTPUT_NEWLINE;
104+ out << vk.G_alpha_H_beta << OUTPUT_NEWLINE;
104105 out << vk.query << OUTPUT_NEWLINE;
105106
106107 return out;
@@ -119,6 +120,8 @@ std::istream& operator>>(std::istream &in, r1cs_se_ppzksnark_verification_key<pp
119120 libff::consume_OUTPUT_NEWLINE (in);
120121 in >> vk.H_gamma ;
121122 libff::consume_OUTPUT_NEWLINE (in);
123+ in >> vk.G_alpha_H_beta ;
124+ libff::consume_OUTPUT_NEWLINE (in);
122125 in >> vk.query ;
123126 libff::consume_OUTPUT_NEWLINE (in);
124127
@@ -130,7 +133,7 @@ bool r1cs_se_ppzksnark_processed_verification_key<ppT>::operator==(const r1cs_se
130133{
131134 return (this ->G_alpha == other.G_alpha &&
132135 this ->H_beta == other.H_beta &&
133- this ->G_alpha_H_beta_ml == other.G_alpha_H_beta_ml &&
136+ this ->G_alpha_H_beta == other.G_alpha_H_beta &&
134137 this ->G_gamma_pc == other.G_gamma_pc &&
135138 this ->H_gamma_pc == other.H_gamma_pc &&
136139 this ->H_pc == other.H_pc &&
@@ -142,7 +145,7 @@ std::ostream& operator<<(std::ostream &out, const r1cs_se_ppzksnark_processed_ve
142145{
143146 out << pvk.G_alpha << OUTPUT_NEWLINE;
144147 out << pvk.H_beta << OUTPUT_NEWLINE;
145- out << pvk.G_alpha_H_beta_ml << OUTPUT_NEWLINE;
148+ out << pvk.G_alpha_H_beta << OUTPUT_NEWLINE;
146149 out << pvk.G_gamma_pc << OUTPUT_NEWLINE;
147150 out << pvk.H_gamma_pc << OUTPUT_NEWLINE;
148151 out << pvk.H_pc << OUTPUT_NEWLINE;
@@ -158,7 +161,7 @@ std::istream& operator>>(std::istream &in, r1cs_se_ppzksnark_processed_verificat
158161 libff::consume_OUTPUT_NEWLINE (in);
159162 in >> pvk.H_beta ;
160163 libff::consume_OUTPUT_NEWLINE (in);
161- in >> pvk.G_alpha_H_beta_ml ;
164+ in >> pvk.G_alpha_H_beta ;
162165 libff::consume_OUTPUT_NEWLINE (in);
163166 in >> pvk.G_gamma_pc ;
164167 libff::consume_OUTPUT_NEWLINE (in);
@@ -212,6 +215,7 @@ r1cs_se_ppzksnark_verification_key<ppT> r1cs_se_ppzksnark_verification_key<ppT>:
212215 result.H_beta = libff::Fr<ppT>::random_element () * libff::G2<ppT>::one ();
213216 result.G_gamma = libff::Fr<ppT>::random_element () * libff::G1<ppT>::one ();
214217 result.H_gamma = libff::Fr<ppT>::random_element () * libff::G2<ppT>::one ();
218+ result.G_alpha_H_beta = ppT::reduced_pairing (result.G_alpha , result.H_beta );
215219
216220 libff::G1_vector<ppT> v;
217221 for (size_t i = 0 ; i < input_size + 1 ; ++i)
@@ -582,7 +586,7 @@ r1cs_se_ppzksnark_processed_verification_key<ppT> r1cs_se_ppzksnark_verifier_pro
582586 r1cs_se_ppzksnark_processed_verification_key<ppT> pvk;
583587 pvk.G_alpha = vk.G_alpha ;
584588 pvk.H_beta = vk.H_beta ;
585- pvk.G_alpha_H_beta_ml = ppT::miller_loop (G_alpha_pc, H_beta_pc);
589+ pvk.G_alpha_H_beta = ppT::final_exponentiation ( ppT:: miller_loop (G_alpha_pc, H_beta_pc) );
586590 pvk.G_gamma_pc = ppT::precompute_G1 (vk.G_gamma );
587591 pvk.H_gamma_pc = ppT::precompute_G2 (vk.H_gamma );
588592 pvk.H_pc = ppT::precompute_G2 (vk.H );
@@ -638,13 +642,13 @@ bool r1cs_se_ppzksnark_online_verifier_weak_IC(const r1cs_se_ppzksnark_processed
638642
639643 libff::Fqk<ppT> test1_l = ppT::miller_loop (ppT::precompute_G1 (proof.A + pvk.G_alpha ),
640644 ppT::precompute_G2 (proof.B + pvk.H_beta )),
641- test1_r1 = pvk.G_alpha_H_beta_ml ,
645+ test1_r1 = pvk.G_alpha_H_beta ,
642646 test1_r2 = ppT::miller_loop (ppT::precompute_G1 (G_psi),
643647 pvk.H_gamma_pc ),
644648 test1_r3 = ppT::miller_loop (ppT::precompute_G1 (proof.C ),
645649 pvk.H_pc );
646650 libff::GT<ppT> test1 = ppT::final_exponentiation (
647- test1_l.unitary_inverse () * test1_r1 * test1_r2 * test1_r3);
651+ test1_l.unitary_inverse () * test1_r2 * test1_r3) * test1_r1 ;
648652
649653 if (test1 != libff::GT<ppT>::one ())
650654 {
0 commit comments