From 3dbd8e792d68005654817638e334e3f59f08ffd7 Mon Sep 17 00:00:00 2001 From: Eric Hsieh Date: Fri, 23 Aug 2019 10:36:16 +0000 Subject: [PATCH] Fix the insertion/extraction operator of r1cs_ppzkadsnark_auth_data --- .../ppzkadsnark/r1cs_ppzkadsnark/r1cs_ppzkadsnark.tcc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/r1cs_ppzkadsnark.tcc b/libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/r1cs_ppzkadsnark.tcc index 92d8cbac..6d9a694c 100644 --- a/libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/r1cs_ppzkadsnark.tcc +++ b/libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/r1cs_ppzkadsnark.tcc @@ -120,8 +120,10 @@ bool r1cs_ppzkadsnark_auth_data::operator==(const r1cs_ppzkadsnark_auth_dat template std::ostream& operator<<(std::ostream &out, const r1cs_ppzkadsnark_auth_data &data) { - out << data.mu; + //A libff::Fr instance cannot be correctly parsed if placed in front of a libff::G2 instance + //This is a ad hoc fix out << data.Lambda; + out << data.mu; out << data.sigma; return out; @@ -130,9 +132,11 @@ std::ostream& operator<<(std::ostream &out, const r1cs_ppzkadsnark_auth_data std::istream& operator>>(std::istream &in, r1cs_ppzkadsnark_auth_data &data) { - in >> data.mu; + //A libff::Fr instance cannot be correctly parsed if placed in front of a libff::G2 instance + //This is a ad hoc fix in >> data.Lambda; - data.sigma; + in >> data.mu; + in >> data.sigma; return in; }