diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-09-15 15:19:54 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-09-15 15:19:54 +0200 |
commit | ce5367452063e4e74e8a690d876274b9395eef69 (patch) | |
tree | 447161d53d5f86eb435df8b924dfeeca18373c2b /src/ringct/rctSigs.cpp | |
parent | Merge pull request #1066 (diff) | |
parent | wallet: fix misdetection of duplicates (diff) | |
download | monero-ce5367452063e4e74e8a690d876274b9395eef69.tar.xz |
Merge pull request #1067
70b78bb wallet: fix misdetection of duplicates (moneromooo-monero)
7d413f6 rct: rework serialization to avoid storing vector sizes (moneromooo-monero)
0ce79ef core: cleanup some typecasting (moneromooo-monero)
Diffstat (limited to 'src/ringct/rctSigs.cpp')
-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); } |