00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __CODEX_KEYSERVICE_VERIFIABLEBLINDKEYMSG_H__
00019 #define __CODEX_KEYSERVICE_VERIFIABLEBLINDKEYMSG_H__
00020
00021 #include "CODEX_Client/Message.h"
00022 #include "CODEX_ThresholdCrypto/DLProof.h"
00023 #include "CODEX_Server/ServerState.h"
00024
00025 namespace CODEX_KeyService
00026 {
00039 class VerifiableBlindKeyMsg : public CODEX_Client::BlindKeyMsg
00040 {
00041 public :
00043 static const unsigned int
00044 NumProofs = CODEX_Server::ServerState::ShareType::NumShares;
00045
00047 typedef CODEX_Server::ServerState::ShareType::ValueType ValueType;
00048
00050 typedef CODEX_Server::ServerState::LSType::LabelType LabelType;
00051
00053 typedef CODEX_ThresholdCrypto::DLProof DLProof;
00054
00056 typedef CODEX_Client::CipherTextType CipherTextType;
00057
00059 typedef CODEX_Client::BlindCipherTextType BlindCipherTextType;
00060
00062 typedef CODEX_Client::BlindPlainTextType BlindPlainTextType;
00063
00065 VerifiableBlindKeyMsg();
00066
00068 VerifiableBlindKeyMsg(
00069 const CODEX_ASN1::OctetString& name,
00070 const BlindPlainTextType& blindedKey,
00071 const CODEX_Ciphers::RSASignature& requestSignature,
00072 #ifdef ELGAMAL
00073 const LabelType& label,
00074 const CODEX_Server::ServerState::ShareSetType& partials,
00075 const vector< DLProof >& proofs,
00076 #endif
00077 const BlindCipherTextType& blindCipher );
00078
00080 VerifiableBlindKeyMsg( const VerifiableBlindKeyMsg& aBKM );
00081
00083 virtual ~VerifiableBlindKeyMsg() {}
00084
00086 void operator=( const VerifiableBlindKeyMsg& aBKM );
00087
00089 CODEX_Client::BlindKeyMsg upcast() const
00090 {
00091 return CODEX_Client::BlindKeyMsg(*this);
00092 }
00093
00095 int marshal( unsigned char ** pp ) const;
00097 void* unmarshal( void* bogus, unsigned char ** pp, long length );
00098
00100 const BlindCipherTextType& blindCipher() const
00101 {
00102 return m_blindCipher;
00103 }
00104
00105 #ifdef ELGAMAL
00106
00107 const LabelType& label() const { return m_label; }
00108
00116 const ValueType& partial( unsigned int i ) const
00117 {
00118 if ( i >= NumProofs )
00119 {
00120 throw CODEX_Exceptions::IllegalIndexException( __FILE__ ,
00121 __LINE__ );
00122 }
00123 return m_partials[i];
00124 }
00125
00133 const DLProof& proof( unsigned int i ) const
00134 {
00135 if ( i >= NumProofs )
00136 {
00137 throw CODEX_Exceptions::IllegalIndexException( __FILE__ ,
00138 __LINE__ );
00139 }
00140 return m_proofs[i];
00141 }
00142 #endif
00143
00144 private :
00145 #ifdef ELGAMAL
00146 LabelType m_label;
00147 ValueType m_partials[NumProofs];
00148 DLProof m_proofs[NumProofs];
00149 #endif
00150 BlindCipherTextType m_blindCipher;
00151 };
00152
00153 }
00154
00155 #endif