Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound 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 Methods

 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
 
Returns:
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.


Static Public Attributes

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


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 69 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 267 of file Combinatoric.h.

References CODEX_ASN1::Base::m_initialized.

Referenced by CODEX_ThresholdCrypto::ThresholdVarRSACrypto< CODEX_VSS::Combinatoric< NumT, ThreshT > >::decrypt(), CODEX_ThresholdCrypto::ThresholdRSACrypto< CODEX_VSS::Combinatoric< NumT, ThreshT > >::decrypt(), CODEX_ThresholdCrypto::ThresholdElGamalCrypto< CODEX_VSS::Combinatoric< NumT, ThreshT > >::decrypt(), CODEX_ThresholdCrypto::ThresholdVarRSACrypto< CODEX_VSS::Combinatoric< NumT, ThreshT > >::sign(), and CODEX_ThresholdCrypto::ThresholdRSACrypto< CODEX_VSS::Combinatoric< NumT, ThreshT > >::sign().

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 333 of file Combinatoric.h.

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

Referenced by 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 208 of file Combinatoric.h.

References CODEX_ASN1::Base::initialized(), CODEX_ASN1::Base::m_initialized, CODEX_VSS::Combinatoric< NumT, ThreshT >::m_shares, 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 283 of file Combinatoric.h.

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 227 of file Combinatoric.h.

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

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 241 of file Combinatoric.h.

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

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 367 of file Combinatoric.h.

References CODEX_ASN1::Base::m_initialized, 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(), 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 79 of file Combinatoric.h.

Referenced by 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 >::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 Wed Jun 2 16:33:24 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18