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