mirror of
https://github.com/monero-project/monero.git
synced 2025-05-02 17:34:53 -04:00
Merge pull request #5052
b6534c40
ringct: remove unused senderPk from ecdhTuple (moneromooo-monero)7d375981
ringct: the commitment mask is now deterministic (moneromooo-monero)99d946e6
ringct: encode 8 byte amount, saving 24 bytes per output (moneromooo-monero)cdc3ccec
ringct: save 3 bytes on bulletproof size (moneromooo-monero)f931e16c
add a bulletproof version, new bulletproof type, and rct config (moneromooo-monero)
This commit is contained in:
commit
0daa00e035
32 changed files with 305 additions and 215 deletions
|
@ -45,6 +45,8 @@
|
|||
#include "ringct/rctTypes.h"
|
||||
#include "ringct/rctOps.h"
|
||||
|
||||
BOOST_CLASS_VERSION(rct::ecdhTuple, 1)
|
||||
|
||||
//namespace cryptonote {
|
||||
namespace boost
|
||||
{
|
||||
|
@ -247,9 +249,19 @@ namespace boost
|
|||
template <class Archive>
|
||||
inline void serialize(Archive &a, rct::ecdhTuple &x, const boost::serialization::version_type ver)
|
||||
{
|
||||
a & x.mask;
|
||||
a & x.amount;
|
||||
// a & x.senderPk; // not serialized, as we do not use it in monero currently
|
||||
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;
|
||||
}
|
||||
|
||||
template <class Archive>
|
||||
|
@ -295,7 +307,7 @@ namespace boost
|
|||
a & x.type;
|
||||
if (x.type == rct::RCTTypeNull)
|
||||
return;
|
||||
if (x.type != rct::RCTTypeFull && x.type != rct::RCTTypeSimple && x.type != rct::RCTTypeBulletproof)
|
||||
if (x.type != rct::RCTTypeFull && x.type != rct::RCTTypeSimple && x.type != rct::RCTTypeBulletproof && x.type != rct::RCTTypeBulletproof2)
|
||||
throw boost::archive::archive_exception(boost::archive::archive_exception::other_exception, "Unsupported rct type");
|
||||
// a & x.message; message is not serialized, as it can be reconstructed from the tx data
|
||||
// a & x.mixRing; mixRing is not serialized, as it can be reconstructed from the offsets
|
||||
|
@ -323,7 +335,7 @@ namespace boost
|
|||
a & x.type;
|
||||
if (x.type == rct::RCTTypeNull)
|
||||
return;
|
||||
if (x.type != rct::RCTTypeFull && x.type != rct::RCTTypeSimple && x.type != rct::RCTTypeBulletproof)
|
||||
if (x.type != rct::RCTTypeFull && x.type != rct::RCTTypeSimple && x.type != rct::RCTTypeBulletproof && x.type != rct::RCTTypeBulletproof2)
|
||||
throw boost::archive::archive_exception(boost::archive::archive_exception::other_exception, "Unsupported rct type");
|
||||
// a & x.message; message is not serialized, as it can be reconstructed from the tx data
|
||||
// a & x.mixRing; mixRing is not serialized, as it can be reconstructed from the offsets
|
||||
|
@ -337,7 +349,7 @@ namespace boost
|
|||
if (x.p.rangeSigs.empty())
|
||||
a & x.p.bulletproofs;
|
||||
a & x.p.MGs;
|
||||
if (x.type == rct::RCTTypeBulletproof)
|
||||
if (x.type == rct::RCTTypeBulletproof || x.type == rct::RCTTypeBulletproof2)
|
||||
a & x.p.pseudoOuts;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue