Electroneum
rct::rctSigBase Struct Reference

#include <rctTypes.h>

Inheritance diagram for rct::rctSigBase:
Collaboration diagram for rct::rctSigBase:

Public Member Functions

template<bool W, template< bool > class Archive>
bool serialize_rctsig_base (Archive< W > &ar, size_t inputs, size_t outputs)
 

Public Attributes

uint8_t type
 
key message
 
ctkeyM mixRing
 
keyV pseudoOuts
 
std::vector< ecdhTupleecdhInfo
 
ctkeyV outPk
 
etn_amount txnFee
 

Detailed Description

Definition at line 240 of file rctTypes.h.

Member Function Documentation

◆ serialize_rctsig_base()

template<bool W, template< bool > class Archive>
bool rct::rctSigBase::serialize_rctsig_base ( Archive< W > &  ar,
size_t  inputs,
size_t  outputs 
)
inline

Definition at line 251 of file rctTypes.h.

252  {
253  FIELD(type)
254  if (type == RCTTypeNull)
255  return ar.stream().good();
257  return false;
259  // inputs/outputs not saved, only here for serialization help
260  // FIELD(message) - not serialized, it can be reconstructed
261  // FIELD(mixRing) - not serialized, it can be reconstructed
262  if (type == RCTTypeSimple) // moved to prunable with bulletproofs
263  {
264  ar.tag("pseudoOuts");
265  ar.begin_array();
267  if (pseudoOuts.size() != inputs)
268  return false;
269  for (size_t i = 0; i < inputs; ++i)
270  {
271  FIELDS(pseudoOuts[i])
272  if (inputs - i > 1)
273  ar.delimit_array();
274  }
275  ar.end_array();
276  }
277 
278  ar.tag("ecdhInfo");
279  ar.begin_array();
281  if (ecdhInfo.size() != outputs)
282  return false;
283  for (size_t i = 0; i < outputs; ++i)
284  {
285  if (type == RCTTypeBulletproof2)
286  {
287  ar.begin_object();
288  if (!typename Archive<W>::is_saving())
289  memset(ecdhInfo[i].amount.bytes, 0, sizeof(ecdhInfo[i].amount.bytes));
290  crypto::hash8 &amount = (crypto::hash8&)ecdhInfo[i].amount;
291  FIELD(amount);
292  ar.end_object();
293  }
294  else
295  {
296  FIELDS(ecdhInfo[i])
297  }
298  if (outputs - i > 1)
299  ar.delimit_array();
300  }
301  ar.end_array();
302 
303  ar.tag("outPk");
304  ar.begin_array();
306  if (outPk.size() != outputs)
307  return false;
308  for (size_t i = 0; i < outputs; ++i)
309  {
310  FIELDS(outPk[i].mask)
311  if (outputs - i > 1)
312  ar.delimit_array();
313  }
314  ar.end_array();
315  return ar.stream().good();
316  }
etn_amount txnFee
Definition: rctTypes.h:248
uint8_t type
Definition: rctTypes.h:241
std::vector< ecdhTuple > ecdhInfo
Definition: rctTypes.h:246
#define FIELDS(f)
does not add a tag to the serialized value
POD_CLASS hash8
Definition: hash.h:53
#define VARINT_FIELD(f)
tags and serializes the varint f
ctkeyV outPk
Definition: rctTypes.h:247
#define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec)
#define FIELD(f)
tags the field with the variable name and then serializes it
Here is the caller graph for this function:

Member Data Documentation

◆ ecdhInfo

std::vector<ecdhTuple> rct::rctSigBase::ecdhInfo

Definition at line 246 of file rctTypes.h.

◆ message

key rct::rctSigBase::message

Definition at line 242 of file rctTypes.h.

◆ mixRing

ctkeyM rct::rctSigBase::mixRing

Definition at line 243 of file rctTypes.h.

◆ outPk

ctkeyV rct::rctSigBase::outPk

Definition at line 247 of file rctTypes.h.

◆ pseudoOuts

keyV rct::rctSigBase::pseudoOuts

Definition at line 245 of file rctTypes.h.

◆ txnFee

etn_amount rct::rctSigBase::txnFee

Definition at line 248 of file rctTypes.h.

◆ type

uint8_t rct::rctSigBase::type

Definition at line 241 of file rctTypes.h.


The documentation for this struct was generated from the following file: