diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-09-14 20:23:06 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-09-14 20:23:06 +0100 |
commit | 7d413f635fb42f8cfe7567b07e981f3a312f8900 (patch) | |
tree | da4a3fb2f6c3b37b6fdb53632978311b05844d49 /src/ringct/rctSigs.cpp | |
parent | core: cleanup some typecasting (diff) | |
download | monero-7d413f635fb42f8cfe7567b07e981f3a312f8900.tar.xz |
rct: rework serialization to avoid storing vector sizes
Diffstat (limited to '')
-rw-r--r-- | src/ringct/rctSigs.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index f4dbd65c5..ed1f8cc0e 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -350,8 +350,16 @@ namespace rct { keyV hashes; hashes.push_back(rv.message); crypto::hash h; - cryptonote::get_blob_hash(cryptonote::t_serializable_object_to_blob((const rctSigBase&)rv), h); + + std::stringstream ss; + binary_archive<true> ba(ss); + const size_t inputs = rv.pseudoOuts.size(); + const size_t outputs = rv.ecdhInfo.size(); + CHECK_AND_ASSERT_THROW_MES(const_cast<rctSig&>(rv).serialize_rctsig_base(ba, inputs, outputs), + "Failed to serialize rctSigBase"); + cryptonote::get_blob_hash(ss.str(), h); hashes.push_back(hash2rct(h)); + keyV kv; for (auto r: rv.p.rangeSigs) { @@ -364,7 +372,6 @@ namespace rct { kv.push_back(r.Ci[n]); } hashes.push_back(cn_fast_hash(kv)); - return cn_fast_hash(hashes); } |