aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctTypes.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-09 21:34:09 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:30:18 +0100
commit93f5c625f058ee1f81c02c8bb03744b28bbde90a (patch)
tree3f8fd5da151bc7000963a50b6f29b0256a762eff /src/ringct/rctTypes.h
parentrct: rework the verification preparation process (diff)
downloadmonero-93f5c625f058ee1f81c02c8bb03744b28bbde90a.tar.xz
rct: rework v2 txes into prunable and non prunable data
Nothing is pruned, but this allows easier changes later.
Diffstat (limited to 'src/ringct/rctTypes.h')
-rw-r--r--src/ringct/rctTypes.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h
index 98876a08c..8211fbaed 100644
--- a/src/ringct/rctTypes.h
+++ b/src/ringct/rctTypes.h
@@ -177,12 +177,9 @@ namespace rct {
RCTTypeFull = 0,
RCTTypeSimple = 1,
};
- struct rctSig {
+ struct rctSigBase {
uint8_t type;
key message;
- vector<rangeSig> rangeSigs;
- mgSig MG; // for non simple rct
- vector<mgSig> MGs; // for simple rct
ctkeyM mixRing; //the set of all pubkeys / copy
//pairs that you mix with
keyV pseudoOuts; //C - for simple rct
@@ -190,14 +187,9 @@ namespace rct {
ctkeyV outPk;
xmr_amount txnFee; // contains b
- BEGIN_SERIALIZE_OBJECT()
+ BEGIN_SERIALIZE()
FIELD(type)
// FIELD(message) - not serialized, it can be reconstructed
- FIELD(rangeSigs)
- if (type == RCTTypeSimple)
- FIELD(MGs)
- else
- FIELD(MG)
// FIELD(mixRing) - not serialized, it can be reconstructed
if (type == RCTTypeSimple)
FIELD(pseudoOuts)
@@ -218,6 +210,23 @@ namespace rct {
FIELD(txnFee)
END_SERIALIZE()
};
+ struct rctSigPrunable {
+ vector<rangeSig> rangeSigs;
+ vector<mgSig> MGs; // simple rct has N, full has 1
+
+ BEGIN_SERIALIZE()
+ FIELD(rangeSigs)
+ FIELD(MGs)
+ END_SERIALIZE()
+ };
+ struct rctSig: public rctSigBase {
+ rctSigPrunable p;
+
+ BEGIN_SERIALIZE_OBJECT()
+ FIELDS(*static_cast<rctSigBase *>(this))
+ FIELDS(p);
+ END_SERIALIZE()
+ };
//other basepoint H = toPoint(cn_fast_hash(G)), G the basepoint
static const key H = { {0x8b, 0x65, 0x59, 0x70, 0x15, 0x37, 0x99, 0xaf, 0x2a, 0xea, 0xdc, 0x9f, 0xf1, 0xad, 0xd0, 0xea, 0x6c, 0x72, 0x51, 0xd5, 0x41, 0x54, 0xcf, 0xa9, 0x2c, 0x17, 0x3a, 0x0d, 0xd3, 0x9c, 0x1f, 0x94} };