Anoncoin  0.9.4
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
libzerocoin::Accumulator Class Reference

Implementation of the RSA-based accumulator. More...

#include <Accumulator.h>

Collaboration diagram for libzerocoin::Accumulator:
[legend]

Public Member Functions

template<typename Stream >
 Accumulator (const AccumulatorAndProofParams *p, Stream &strm)
 Construct an Accumulator from a stream. More...
 
template<typename Stream >
 Accumulator (const Params *p, Stream &strm)
 
 Accumulator (const AccumulatorAndProofParams *p, const CoinDenomination d)
 Construct an Accumulator from a Params object. More...
 
 Accumulator (const Params *p, const CoinDenomination d)
 
void accumulate (const PublicCoin &coin)
 Accumulate a coin into the accumulator. More...
 
CoinDenomination getDenomination () const
 
Bignum getValue () const
 Get the accumulator result. More...
 
Accumulatoroperator+= (const PublicCoin &c)
 Used to set the accumulator value. More...
 
bool operator== (const Accumulator rhs) const
 

Public Attributes

IMPLEMENT_SERIALIZE(READWRITE(value);READWRITE(denomination);) private Bignum value
 
CoinDenomination denomination
 

Detailed Description

Implementation of the RSA-based accumulator.

Definition at line 20 of file Accumulator.h.

Constructor & Destructor Documentation

template<typename Stream >
libzerocoin::Accumulator::Accumulator ( const AccumulatorAndProofParams p,
Stream &  strm 
)
inline

Construct an Accumulator from a stream.

Parameters
pAn AccumulatorAndProofParams object containing global parameters
dthe denomination of coins we are accumulating
Exceptions
Zerocoinexception in case of invalid parameters

Definition at line 30 of file Accumulator.h.

template<typename Stream >
libzerocoin::Accumulator::Accumulator ( const Params p,
Stream &  strm 
)
inline

Definition at line 35 of file Accumulator.h.

libzerocoin::Accumulator::Accumulator ( const AccumulatorAndProofParams p,
const CoinDenomination  d 
)

Construct an Accumulator from a Params object.

Parameters
pA Params object containing global parameters
dthe denomination of coins we are accumulating
Exceptions
Zerocoinexception in case of invalid parameters

Definition at line 20 of file Accumulator.cpp.

libzerocoin::Accumulator::Accumulator ( const Params p,
const CoinDenomination  d 
)

Definition at line 28 of file Accumulator.cpp.

Member Function Documentation

void libzerocoin::Accumulator::accumulate ( const PublicCoin coin)

Accumulate a coin into the accumulator.

Validates the coin prior to accumulation.

Parameters
coinA PublicCoin to accumulate.
Exceptions
Zerocoinexception if the coin is not valid.

Definition at line 39 of file Accumulator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CoinDenomination libzerocoin::Accumulator::getDenomination ( ) const

Definition at line 71 of file Accumulator.cpp.

Here is the caller graph for this function:

Bignum libzerocoin::Accumulator::getValue ( ) const

Get the accumulator result.

Returns
a Bignum containing the result.

Definition at line 75 of file Accumulator.cpp.

Here is the caller graph for this function:

Accumulator & libzerocoin::Accumulator::operator+= ( const PublicCoin c)

Used to set the accumulator value.

Use this to handle accumulator checkpoints

Parameters
bthe value to set the accumulator to.
Exceptions
AZerocoinException if the accumulator value is invalid. Used to accumulate a coin
Parameters
cthe coin to accumulate
Returns
a refrence to the updated accumulator.

Definition at line 79 of file Accumulator.cpp.

Here is the call graph for this function:

bool libzerocoin::Accumulator::operator== ( const Accumulator  rhs) const

Definition at line 84 of file Accumulator.cpp.

Member Data Documentation

CoinDenomination libzerocoin::Accumulator::denomination

Definition at line 94 of file Accumulator.h.

IMPLEMENT_SERIALIZE ( READWRITE(value); READWRITE(denomination); ) private Bignum libzerocoin::Accumulator::value

Definition at line 87 of file Accumulator.h.


The documentation for this class was generated from the following files: