Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

CODEX_APSS::SecretManagement Class Reference

Management information for a shared secret. More...

#include <SecretManagement.h>

Collaboration diagram for CODEX_APSS::SecretManagement:

Collaboration graph
[legend]
List of all members.

Public Types

typedef vector< FinishedMsgFinishedMsgList
 A list of FinishedMsgs indicating termination of the protocol.

typedef CODEX_Server::ServerState::ShareCallback ShareCallbackBase
 Shorthand for the type of a share-retrieval callback.


Public Methods

 SecretManagement ()
 Constructor.

virtual ~SecretManagement ()
 Virtual destructor.

void setNum (unsigned int num)
 Set the identification number for this shared secret.

unsigned long version () const
 
Returns:
The current version (epoch) for this secret.


void setSubshareRange (const CODEX_VSS::Range *subshareRange)
 Set the range used to generate subshares.

const CODEX_VSS::RangesubshareRange () const
 
Returns:
The range in which to generate subshares.


void addSharing (LSType *sharing)
 Add a new labeled sharing.

bool labelValid (const LabelType &label) const
 Test the (local) validity of a label.

const LSTypesharing (const LSType::LabelType &label, unsigned int server) const
 Get the sharing with a particular label.

void setWitness (const WitnessType &witness)
 Set the witness for the secret.

const WitnessTypewitness () const
 Get the witness for the secret.

const ShareSetTypesubsharing (const SublabelType &sublabel, unsigned int server) const
 Get the subsharing with a particular label.

SubshareListsplittings (const LabelType &label)
 Get the splittings of the shares with a particular label.

void addSubsharing (const SublabelType &label, const ShareType &subsharing)
 Add a new labeled subsharing.

bool addInitMsg (const SignedInitMsg &im)
 Add a SignedInitMsg to the log.

bool addEstablishMsg (const SignedEstablishMsg &em)
 Add a SignedEstablishMsg to the log.

bool addComputeMsg (const SignedComputeMsg &cm)
 Add a SignedComputeMsg to the log.

bool addFinishedMsg (const SignedFinishedMsg &fm)
 Add a SignedFinishedMsg to the log.

bool addInitResponse (const SignedContributeMsg &cm)
 Add a SignedContributeMsg to the log.

bool addEstablishResponse (const SignedEstablishedMsg &em)
 Add a SignedEstablishedMsg to the log.

bool addComputeResponse (const SignedComputedMsg &cm)
 Add a SignedComputedMsg to the log.

void clearEstablishMsgs ()
 Remove cached EstablishMsgs.

void clearEstablishMsgs (unsigned int establisher)
 Removed cached EstablishMsgs that were sent by a particular server.

const InitRecordinitRecord (unsigned int i) const
 Retrieve the InitRecord for a coordinator.

const EstablishRecordestablishRecord (unsigned int establisher, unsigned int shareNum, const LabelType &label) const
 Retrieve the EstablishRecord for an establishing server and a specific share.

const ComputeRecordcomputeRecord (unsigned int i) const
 Retrieve the ComputeRecord for a coordinator.

const SignedFinishedMsgfinishedMsg (unsigned int i) const
 Retrieve the SignedFinishedMsg from a coordinator.

void setEpochTime ()
 Set the beginning of the epoch to the current time.

unsigned long elapsed (unsigned long current) const
 Length of time since the epoch began.

void beginRun ()
 Begin an instance of the APSS protocol.

void sendFinished (unsigned int server) const
 Send a SignedFinishedMsg to a server.

void sendFinished (unsigned int coord, unsigned int server) const
 Send a SignedFinishedMsg to a server.


Static Public Attributes

const unsigned int NumServers
 Shorthand for the number of servers in the system.

const unsigned int NumShares = LabelType::NumShares
 Shorthand for the number of shares in a sharing.


Protected Methods

void setRunTime ()
 Set the beginning of a protocol instance to the current time.


Detailed Description

Management information for a shared secret.

This class holds all of the necessary information for managing a shared secret. This includes version information, subshares, and cached protocol messages. By encapsulating the information in this way, the APSS protocols can accomodate multiple shared secrets.

Definition at line 39 of file SecretManagement.h.


Member Function Documentation

bool SecretManagement::addComputeMsg const SignedComputeMsg   cm
 

Add a SignedComputeMsg to the log.

Parameters:
cm  The request to add.
Returns:
Whether the message was added successfully.

Definition at line 289 of file SecretManagement.cc.

References CODEX_ASN1::Base::initialized(), CODEX_VSS::SubshareLabel< LabelType >::label(), NumShares, CODEX_APSS::ComputeRecord::request(), CODEX_APSS::ComputeMsg::subshareLabel(), and version().

bool SecretManagement::addComputeResponse const SignedComputedMsg   cm
 

Add a SignedComputedMsg to the log.

This will be matched with the corresponding ComputeMsg.

Parameters:
cm  The response to add.
Returns:
Whether the message was added successfully.

Definition at line 541 of file SecretManagement.cc.

References CODEX_APSS::ComputeRecord::addResponse(), CODEX_ASN1::Base::initialized(), CODEX_VSS::SubshareLabel< LabelType >::label(), CODEX_APSS::ComputeRecord::request(), and CODEX_APSS::ComputeMsg::subshareLabel().

bool SecretManagement::addEstablishMsg const SignedEstablishMsg   em
 

Add a SignedEstablishMsg to the log.

Parameters:
em  The request to add.
Returns:
Whether the message was added successfully.

Definition at line 254 of file SecretManagement.cc.

References CODEX_APSS::EstablishRecord::addRequest(), addSubsharing(), CODEX_ASN1::Base::initialized(), CODEX_APSS::EstablishRecord::request(), CODEX_APSS::ShareType, and CODEX_APSS::EstablishMsg::sublabel().

bool SecretManagement::addEstablishResponse const SignedEstablishedMsg   em
 

Add a SignedEstablishedMsg to the log.

This will be matched with the corresponding EstablishMsg.

Parameters:
em  The response to add.
Returns:
Whether the message was added successfully.

Definition at line 522 of file SecretManagement.cc.

References CODEX_APSS::EstablishRecord::addResponse(), CODEX_ASN1::Base::initialized(), CODEX_APSS::EstablishRecord::request(), CODEX_ASN1::Integer::value(), and CODEX_APSS::EstablishMsg::version().

bool SecretManagement::addFinishedMsg const SignedFinishedMsg   fm
 

Add a SignedFinishedMsg to the log.

If this is the first SignedFinishedMsg for a new version, the following cleanup will be performed:

  • Old shares will be deleted
  • Old subshares propagated by servers will be deleted
  • Old subshares created by the local server will be deleted
  • Old EstablishMsgs will be deleted from the log
Parameters:
fm  The request to add.
Returns:
Whether the message was added successfully.

Definition at line 325 of file SecretManagement.cc.

References CODEX_Server::ServerState::hostNum(), CODEX_Server::ServerState::instance(), NumServers, NumShares, CODEX_Server::ServerState::setDefaultLabel(), setEpochTime(), CODEX_APSS::SharingList, CODEX_APSS::SignedFinishedMsg, CODEX_APSS::SplittingMap, CODEX_APSS::SubsharingMap, and version().

bool SecretManagement::addInitMsg const SignedInitMsg   im
 

Add a SignedInitMsg to the log.

Parameters:
im  The request to add.
Returns:
Whether the message was added successfully.

Definition at line 216 of file SecretManagement.cc.

References CODEX_ASN1::Base::initialized(), CODEX_APSS::InitMsg::label(), CODEX_APSS::InitRecord::request(), CODEX_ASN1::Integer::value(), CODEX_APSS::InitMsg::version(), and version().

bool SecretManagement::addInitResponse const SignedContributeMsg   cm
 

Add a SignedContributeMsg to the log.

This will be matched with the corresponding InitMsg.

Parameters:
cm  The response to add.
Returns:
Whether the message was added successfully.

Definition at line 505 of file SecretManagement.cc.

References CODEX_APSS::InitRecord::addResponse(), CODEX_ASN1::Base::initialized(), CODEX_APSS::InitRecord::request(), CODEX_ASN1::Integer::value(), and CODEX_APSS::InitMsg::version().

void SecretManagement::addSharing LSType   sharing
 

Add a new labeled sharing.

If this is the first sharing for its version number, the list will be cleared and this sharing's label set as the server's default.

Definition at line 75 of file SecretManagement.cc.

References CODEX_ASN1::Base::initialized(), CODEX_VSS::LabeledShare< ShareType, OneWay >::label(), CODEX_ASN1::Integer::value(), and version().

void SecretManagement::clearEstablishMsgs unsigned int    establisher
 

Removed cached EstablishMsgs that were sent by a particular server.

Parameters:
establisher  The server from which the messages originated.

Definition at line 572 of file SecretManagement.cc.

References NumShares.

const ComputeRecord & SecretManagement::computeRecord unsigned int    i const
 

Retrieve the ComputeRecord for a coordinator.

Parameters:
i  The coordinator initiating an instance of the APSS protocol.
Returns:
An object containing the most recent ComputeMsg sent by the specified coordinator, as well as any cached response.

Definition at line 607 of file SecretManagement.cc.

References NumServers.

unsigned long SecretManagement::elapsed unsigned long    current const
 

Length of time since the epoch began.

Parameters:
current  The current time, in seconds.
Returns:
The number of seconds that have elapsed since the epoch began

Definition at line 651 of file SecretManagement.cc.

const EstablishRecord & SecretManagement::establishRecord unsigned int    establisher,
unsigned int    shareNum,
const LabelType   label
const
 

Retrieve the EstablishRecord for an establishing server and a specific share.

Parameters:
establisher  The server propagating a subsharing for a share.
shareNum  The index of the share split by the server.
label  The label for a sharing from which the split share is drawn.
Returns:
An object containing the EstablishMsg for the specified subsharing, as well as any cached response.

Definition at line 591 of file SecretManagement.cc.

References CODEX_APSS::LabelType, NumServers, and NumShares.

const SignedFinishedMsg & SecretManagement::finishedMsg unsigned int    i const
 

Retrieve the SignedFinishedMsg from a coordinator.

Parameters:
i  The coordinator initiating an instance of the APSS protocol.
Returns:
A signed FinishedMsg indicating the successful termination of the APSS protocol, which is uninitialized if there is no currently-valid sharing established by this coordinator.

Definition at line 617 of file SecretManagement.cc.

References NumServers.

const InitRecord & SecretManagement::initRecord unsigned int    i const
 

Retrieve the InitRecord for a coordinator.

Parameters:
i  The coordinator initiating an instance of the APSS protocol.
Returns:
An object containing the most recent InitMsg sent by the specified coordinator, as well as any cached response.

Definition at line 581 of file SecretManagement.cc.

References NumServers.

bool SecretManagement::labelValid const LabelType   label const
 

Test the (local) validity of a label.

This only considers whether a label is valid at this server.

Parameters:
label  A label for a sharing
Returns:
Whether or not the label is known locally

Definition at line 115 of file SecretManagement.cc.

References CODEX_APSS::LabelType, and NumServers.

Referenced by sharing().

void SecretManagement::sendFinished unsigned int    coord,
unsigned int    server
const
 

Send a SignedFinishedMsg to a server.

Parameters:
coord  The coordinator establishing the sharing
server  The server to which the message should be sent

Definition at line 772 of file SecretManagement.cc.

References CODEX_APSS::StateInfo::domain(), CODEX_Quorum::Message::fill(), CODEX_Server::ServerState::hostNum(), CODEX_Server::ServerState::instance(), CODEX_Server::ServerState::newSequenceNumber(), CODEX_Server::ServerState::nMID, CODEX_Server::ServerState::OutgoingMask, and CODEX_APSS::StateInfo::sendTo().

void SecretManagement::sendFinished unsigned int    server const
 

Send a SignedFinishedMsg to a server.

This method will use the message corresponding to the default label for the secret.

Parameters:
server  The server to which the message should be sent

Definition at line 758 of file SecretManagement.cc.

References NumServers.

Referenced by sharing(), and subsharing().

void SecretManagement::setSubshareRange const CODEX_VSS::Range   subshareRange
 

Set the range used to generate subshares.

Parameters:
subshareRange  Pointer to a range object. The memory is not managed by this class.

Definition at line 59 of file SecretManagement.cc.

void CODEX_APSS::SecretManagement::setWitness const WitnessType   witness [inline]
 

Set the witness for the secret.

Parameters:
witness  The witness used to validate a label.

Definition at line 116 of file SecretManagement.h.

References witness().

const LSType & SecretManagement::sharing const LSType::LabelType   label,
unsigned int    server
const
 

Get the sharing with a particular label.

If the label is not present locally share recovery will be triggered, but only if the version number in the label is greater than the current local version number or they are equal and no sharing was established at this server by the specified coordinator.

Parameters:
label  The label requested.
server  The requesting server. This is needed in order to send finished messages in response to out-of-date labels.
Returns:
The sharing, if present
Exceptions:
CODEX_Server::KeySharesNotFoundException  if the label does not exist at this server.

Definition at line 133 of file SecretManagement.cc.

References labelValid(), sendFinished(), and version().

SubshareList & SecretManagement::splittings const LabelType   label
 

Get the splittings of the shares with a particular label.

If a label is not present, an empty list will be returned. As the return value is a non-constant reference, it can be used to add subsharings to the stored list. This is the expected way for an object to create and store subsharings of shares. Each share that is split by the server will have a separate entry in the returned list.

Parameters:
label  The label for a sharing
Returns:
The labeled subsharings generated by this server of shares with the supplied label

Definition at line 210 of file SecretManagement.cc.

References CODEX_APSS::LabelType.

const ShareSetType & SecretManagement::subsharing const SublabelType   sublabel,
unsigned int    server
const
 

Get the subsharing with a particular label.

If the label is not present locally an exception will be thrown.

Parameters:
sublabel  The label requested.
server  The requesting server. This is needed in order to send finished messages in response to out-of-date labels.
Returns:
The subsharing, if present
Exceptions:
CODEX_Server::KeySharesNotFoundException  if the label does not exist at this server.

Definition at line 190 of file SecretManagement.cc.

References CODEX_VSS::SubshareLabel< LabelType >::label(), and sendFinished().

const WitnessType& CODEX_APSS::SecretManagement::witness   const [inline]
 

Get the witness for the secret.

The witness is used to test the validity of a label.

Returns:
The witness for this secret.

Definition at line 123 of file SecretManagement.h.

Referenced by setWitness().


Member Data Documentation

const unsigned int CODEX_APSS::SecretManagement::NumServers [static]
 

Initial value:

Shorthand for the number of servers in the system.

Definition at line 43 of file SecretManagement.h.

Referenced by addFinishedMsg(), clearEstablishMsgs(), computeRecord(), establishRecord(), finishedMsg(), initRecord(), labelValid(), and sendFinished().


The documentation for this class was generated from the following files:
Generated on Wed Jun 2 16:33:01 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18