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

A witness that a PublicCoin is in the accumulation of a set of coins. More...

#include <Accumulator.h>

Collaboration diagram for libzerocoin::AccumulatorWitness:
[legend]

Public Member Functions

template<typename Stream >
 AccumulatorWitness (const Params *p, Stream &strm)
 
 AccumulatorWitness (const Params *p, const Accumulator &checkpoint, const PublicCoin coin)
 Constructs a witness. More...
 
void AddElement (const PublicCoin &c)
 Adds element to the set whose accumulation we are proving coin is a member of. More...
 
Bignum getValue () const
 
bool VerifyWitness (const Accumulator &a, const PublicCoin &publicCoin) const
 Checks that this is a witness to the accumulation of coin. More...
 
AccumulatorWitnessoperator+= (const PublicCoin &rhs)
 Adds rhs to the set whose accumulation we're proving coin is a member of. More...
 

Private Attributes

const Paramsparams
 
Accumulator witness
 
const PublicCoin element
 

Detailed Description

A witness that a PublicCoin is in the accumulation of a set of coins.

Definition at line 100 of file Accumulator.h.

Constructor & Destructor Documentation

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

Definition at line 103 of file Accumulator.h.

libzerocoin::AccumulatorWitness::AccumulatorWitness ( const Params p,
const Accumulator checkpoint,
const PublicCoin  coin 
)

Constructs a witness.

You must add all elements after the witness

Parameters
ppointer to params
checkpointthe last known accumulator value before the element was added
cointhe coin we want a witness to

Definition at line 89 of file Accumulator.cpp.

Member Function Documentation

void libzerocoin::AccumulatorWitness::AddElement ( const PublicCoin c)

Adds element to the set whose accumulation we are proving coin is a member of.

Parameters
cthe coin to add

Definition at line 93 of file Accumulator.cpp.

Here is the caller graph for this function:

Bignum libzerocoin::AccumulatorWitness::getValue ( ) const
Returns
the value of the witness

Definition at line 99 of file Accumulator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

AccumulatorWitness & libzerocoin::AccumulatorWitness::operator+= ( const PublicCoin rhs)

Adds rhs to the set whose accumulation we're proving coin is a member of.

Parameters
rhsthe PublicCoin to add
Returns

Definition at line 109 of file Accumulator.cpp.

Here is the call graph for this function:

bool libzerocoin::AccumulatorWitness::VerifyWitness ( const Accumulator a,
const PublicCoin publicCoin 
) const

Checks that this is a witness to the accumulation of coin.

Parameters
athe accumulator we are checking against.
publicCointhe coin we're providing a witness for
Returns
True if the witness computation validates

Definition at line 103 of file Accumulator.cpp.

Here is the caller graph for this function:

Member Data Documentation

const PublicCoin libzerocoin::AccumulatorWitness::element
private

Definition at line 142 of file Accumulator.h.

const Params* libzerocoin::AccumulatorWitness::params
private

Definition at line 140 of file Accumulator.h.

Accumulator libzerocoin::AccumulatorWitness::witness
private

Definition at line 141 of file Accumulator.h.


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