Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CODEX_VSS::Combinatoric< NumT, ThreshT > Class Template Reference

Combinatoric-based secret sharing scheme, based on modular addition. More...

#include <Combinatoric.h>

Inheritance diagram for CODEX_VSS::Combinatoric< NumT, ThreshT >:

Inheritance graph
[legend]
Collaboration diagram for CODEX_VSS::Combinatoric< NumT, ThreshT >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef CODEX_ASN1::SecureBigNumber ValueType
 Export the type of the share.

Public Member Functions

 Combinatoric ()
 Default constructor, for creating an object to be unmarshalled.
 Combinatoric (const Combinatoric< NumT, ThreshT > &aOther)
 Copy constructor.
 Combinatoric (const ShareSet< Combinatoric< NumT, ThreshT > > &shareSet, unsigned int partNum)
 Create a Combinatoric from a ShareSet.
virtual ~Combinatoric ()
 Virtual destructor.
void operator= (const Combinatoric< NumT, ThreshT > &aOther)
 Assignment operator.
void operator+= (const Combinatoric< NumT, ThreshT > &aOther)
 In-place addition operator.
void setShare (unsigned int i, const CODEX_ASN1::SecureBigNumber &share)
 Set a share in the array.
const CODEX_ASN1::SecureBigNumbershare (unsigned int i) const
 Retrieve a share.
unsigned int count () const
 The number of shares held by this object.
void apply (const ShareFunctional &func, Combinatoric< NumT, ThreshT > &result) const
 Apply a function to each share, generating new shares.
void recover (CODEX_ASN1::SecureBigNumber &result) const
 Recover the secret from the shares.
int marshal (unsigned char **pp) const
 This function creates a serialized representation of the object, which is returned through the argument pp.
void * unmarshal (void *bogus, unsigned char **pp, long length)
 This function takes a serialized representation of the object and recreates the object representation.
void toFile (const char *fname) const
 Store the shares in a file.
void * fromFile (const char *fname)
 Read shares from a file.
bool initialized () const

Static Public Attributes

static const unsigned int NumShares = choose<NumT,ThreshT-1>::value+1
 Number of shares distributed among the NumT participants.

Protected Attributes

bool m_initialized
 Has this object been initialized yet, or is it still blank?

Detailed Description

template<unsigned int NumT, unsigned int ThreshT>
class CODEX_VSS::Combinatoric< NumT, ThreshT >

Combinatoric-based secret sharing scheme, based on modular addition.

Definition at line 72 of file Combinatoric.h.


Member Function Documentation

template<unsigned int NumT, unsigned int ThreshT>
void CODEX_VSS::Combinatoric< NumT, ThreshT >::apply const ShareFunctional func,
Combinatoric< NumT, ThreshT > &  result
const
 

Apply a function to each share, generating new shares.

Returns:
A new Combinatoric where the shares are the function applied to this object's shares.
Todo:
change: result should be a parameter

Definition at line 270 of file Combinatoric.h.

References CODEX_ASN1::Base::initialized(), CODEX_ASN1::Base::m_initialized, and CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares.

bool CODEX_ASN1::Base::initialized  )  const [inline, inherited]
 

Returns:
Has this object been initialized?

Definition at line 175 of file Base.h.

References CODEX_ASN1::Base::m_initialized.

Referenced by CODEX_APSS::SecretManagement::addComputeMsg(), CODEX_APSS::SecretManagement::addEstablishMsg(), CODEX_APSS::SecretManagement::addEstablishResponse(), CODEX_APSS::SecretManagement::addInitMsg(), CODEX_APSS::SecretManagement::addSharing(), CODEX_APSS::SecretManagement::addSubsharing(), CODEX_VSS::Combinatoric< NumT, ThreshT >::apply(), CODEX_Server::ServerState::caKey(), CODEX_KeyService::ClientCreateCallback::ClientCreateCallback(), CODEX_VSS::Combinatoric< NumT, ThreshT >::count(), CODEX_Server::QuorumBuilderAct::handler(), CODEX_APSS::MessageVerifier::handler(), CODEX_KeyService::DelegateResponseVerifier::handler(), CODEX_KeyService::DelegateRequestDistributor::handler(), CODEX_KeyService::ClientMessageVerifier::handler(), CODEX_KeyService::ClientMessageSigner::handler(), CODEX_VSS::SubshareLabel< LabelType >::marshal(), CODEX_KeyService::KeyInfo::marshal(), CODEX_VSS::LabeledShare< ShareType, OneWay >::marshal(), CODEX_VSS::ShareLabel< _ShareType, _OneWay >::marshal(), CODEX_VSS::ModExpFunctionalArgs::marshal(), CODEX_VSS::Combinatoric< NumT, ThreshT >::marshal(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), CODEX_VSS::ModExpFunctional::operator()(), CODEX_KeyService::ClientReadCallback::operator()(), CODEX_KeyService::ClientCreateCallback::operator()(), CODEX_VSS::Combinatoric< NumT, ThreshT >::operator+=(), CODEX_Server::ServerState::readElGamalShares(), CODEX_VSS::Combinatoric< NumT, ThreshT >::recover(), CODEX_APSS::SecretManagement::sendFinished(), CODEX_Server::ServerState::serviceKey(), CODEX_Server::ServerState::setEGShareCallback(), and CODEX_Server::ServerState::setRSAShareCallback().

template<unsigned int NumT, unsigned int ThreshT>
int CODEX_VSS::Combinatoric< NumT, ThreshT >::marshal unsigned char **  pp  )  const [virtual]
 

This function creates a serialized representation of the object, which is returned through the argument pp.

This must be overridden by the concrete derived class.

Parameters:
pp Serialized form of the object
Returns:
Length of the marshalled data

Implements CODEX_ASN1::Base.

Definition at line 336 of file Combinatoric.h.

References CODEX_ASN1::Base::initialized(), CODEX_ASN1::BigNumber::marshal(), CODEX_ASN1::Integer::marshal(), and CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares.

Referenced by CODEX_KeyService::ClientMessageSigner::handler(), CODEX_APSS::RecoveredMsg::marshal(), CODEX_APSS::EstablishMsg::marshal(), and CODEX_VSS::Combinatoric< NumT, ThreshT >::toFile().

template<unsigned int NumT, unsigned int ThreshT>
void CODEX_VSS::Combinatoric< NumT, ThreshT >::operator+= const Combinatoric< NumT, ThreshT > &  aOther  ) 
 

In-place addition operator.

The semantics of this are different than are typical for scalar types. Elements that have been set are not changed. What is done is that any elements present in aOther but not the current object are added to the list of shares.

Definition at line 211 of file Combinatoric.h.

References CODEX_ASN1::Base::initialized(), and CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares.

template<unsigned int NumT, unsigned int ThreshT>
void CODEX_VSS::Combinatoric< NumT, ThreshT >::recover CODEX_ASN1::SecureBigNumber result  )  const
 

Recover the secret from the shares.

Parameters:
result This should be uninitialized before calling, and will be uninitialized on return if an error occurred.

Definition at line 286 of file Combinatoric.h.

References CODEX_ASN1::Base::initialized(), and CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares.

template<unsigned int NumT, unsigned int ThreshT>
void CODEX_VSS::Combinatoric< NumT, ThreshT >::setShare unsigned int  i,
const CODEX_ASN1::SecureBigNumber share
 

Set a share in the array.

Parameters:
i The index of the share.
share The share to add.

Definition at line 230 of file Combinatoric.h.

References CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares, and CODEX_VSS::Combinatoric< NumT, ThreshT >::share().

Referenced by CODEX_VSS::ShareSplitting< Combinatoric< NumT, ThreshT > >::split().

template<unsigned int NumT, unsigned int ThreshT>
const CODEX_ASN1::SecureBigNumber & CODEX_VSS::Combinatoric< NumT, ThreshT >::share unsigned int  i  )  const
 

Retrieve a share.

Parameters:
i The index of the share to retrieve.

Definition at line 244 of file Combinatoric.h.

References CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares.

Referenced by CODEX_VSS::Combinatoric< NumT, ThreshT >::setShare().

template<unsigned int NumT, unsigned int ThreshT>
void * CODEX_VSS::Combinatoric< NumT, ThreshT >::unmarshal void *  bogus,
unsigned char **  pp,
long  length
[virtual]
 

This function takes a serialized representation of the object and recreates the object representation.

This must be overridden by the concrete derived class.

Parameters:
bogus Included for compatibility with OpenSSL ASN.1 macros
pp Serialized form of the data
length Number of bytes of pp to unmarshal
Returns:
success or failure of the unmarshalling

Implements CODEX_ASN1::Base.

Definition at line 370 of file Combinatoric.h.

References CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares, CODEX_VSS::Combinatoric< NumT, ThreshT >::unmarshal(), CODEX_ASN1::Integer::unmarshal(), and CODEX_ASN1::Integer::value().

Referenced by CODEX_VSS::Combinatoric< NumT, ThreshT >::fromFile(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), CODEX_APSS::RecoveredMsg::unmarshal(), CODEX_APSS::EstablishMsg::unmarshal(), and CODEX_VSS::Combinatoric< NumT, ThreshT >::unmarshal().


Member Data Documentation

template<unsigned int NumT, unsigned int ThreshT>
const unsigned int CODEX_VSS::Combinatoric< NumT, ThreshT >::NumShares = choose<NumT,ThreshT-1>::value+1 [static]
 

Number of shares distributed among the NumT participants.

This includes a public share that every participant receives.

Definition at line 82 of file Combinatoric.h.

Referenced by CODEX_VSS::Combinatoric< NumT, ThreshT >::apply(), CODEX_VSS::Combinatoric< NumT, ThreshT >::Combinatoric(), CODEX_VSS::Combinatoric< NumT, ThreshT >::count(), CODEX_VSS::Combinatoric< NumT, ThreshT >::marshal(), CODEX_VSS::Combinatoric< NumT, ThreshT >::operator+=(), CODEX_VSS::Combinatoric< NumT, ThreshT >::operator=(), CODEX_VSS::Combinatoric< NumT, ThreshT >::recover(), CODEX_VSS::Combinatoric< NumT, ThreshT >::setShare(), CODEX_VSS::Combinatoric< NumT, ThreshT >::share(), and CODEX_VSS::Combinatoric< NumT, ThreshT >::unmarshal().


The documentation for this class was generated from the following file:
Generated on Fri May 6 17:42:53 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1