@@ -10,11 +10,15 @@ libutt::api::Commitment operator+(libutt::api::Commitment lhs, const libutt::api
1010}
1111
1212std::ostream& operator <<(std::ostream& out, const libutt::api::Commitment& comm) {
13- out << comm.pImpl_ ->comm_ ;
13+ out << comm.pImpl_ ->comm_ << endl;
14+ out << comm.pImpl_ ->nonce << endl;
1415 return out;
1516}
1617std::istream& operator >>(std::istream& in, libutt::api::Commitment& comm) {
1718 in >> comm.pImpl_ ->comm_ ;
19+ libff::consume_OUTPUT_NEWLINE (in);
20+ in >> comm.pImpl_ ->nonce ;
21+ libff::consume_OUTPUT_NEWLINE (in);
1822 return in;
1923}
2024
@@ -25,12 +29,14 @@ bool operator==(const libutt::api::Commitment& comm1, const libutt::api::Commitm
2529}
2630namespace libutt ::api {
2731
28- Commitment::Commitment (const UTTParams& d, Type t, const std::vector<types::CurvePoint>& messages, bool withG2) {
32+ Commitment::Commitment (
33+ const UTTParams& d, Type t, const std::vector<types::CurvePoint>& messages, bool withG2, uint64_t nonce) {
2934 std::vector<Fr> fr_messages (messages.size ());
3035 for (size_t i = 0 ; i < messages.size (); i++) {
3136 fr_messages[i].from_words (messages.at (i));
3237 }
3338 pImpl_ = new Commitment::Impl ();
39+ pImpl_->nonce = nonce;
3440 pImpl_->comm_ =
3541 libutt::Comm::create (Impl::getCommitmentKey (d.pImpl_ ->p , (Commitment::Impl::Type)t), fr_messages, withG2);
3642}
0 commit comments