aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-08 16:05:18 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-22 23:17:39 +0000
commit7d375981584e5ddac4ea6ad8879e2211d465b79d (patch)
tree82341e77219309514ab8bc12d6c3bd65b60a2293 /src/cryptonote_basic
parentringct: encode 8 byte amount, saving 24 bytes per output (diff)
downloadmonero-7d375981584e5ddac4ea6ad8879e2211d465b79d.tar.xz
ringct: the commitment mask is now deterministic
saves space in the tx and is safe Found by knaccc
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r--src/cryptonote_basic/cryptonote_boost_serialization.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cryptonote_basic/cryptonote_boost_serialization.h b/src/cryptonote_basic/cryptonote_boost_serialization.h
index 6f26d8756..8a527b898 100644
--- a/src/cryptonote_basic/cryptonote_boost_serialization.h
+++ b/src/cryptonote_basic/cryptonote_boost_serialization.h
@@ -249,15 +249,18 @@ namespace boost
template <class Archive>
inline void serialize(Archive &a, rct::ecdhTuple &x, const boost::serialization::version_type ver)
{
- a & x.mask;
if (ver < 1)
{
+ a & x.mask;
a & x.amount;
return;
}
crypto::hash8 &amount = (crypto::hash8&)x.amount;
if (!Archive::is_saving::value)
+ {
+ memset(&x.mask, 0, sizeof(x.mask));
memset(&x.amount, 0, sizeof(x.amount));
+ }
a & amount;
// a & x.senderPk; // not serialized, as we do not use it in monero currently
}