fixed to compile with Intel compiler

pull/2/head
weidai 2002-11-19 20:44:40 +00:00
parent 4cbd2ef39e
commit 39fd2045e9
5 changed files with 16 additions and 15 deletions

4
dh.h
View File

@ -33,7 +33,7 @@ public:
{m_groupParameters.Initialize(v1, v2);}
template <class T2, class T3>
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T2 &v3)
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3)
{m_groupParameters.Initialize(v1, v2, v3);}
template <class T2, class T3, class T4>
@ -45,7 +45,7 @@ public:
{m_groupParameters.Initialize(v1, v2);}
template <class T1, class T2, class T3>
DH_Domain(const T1 &v1, const T2 &v2, const T2 &v3)
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3)
{m_groupParameters.Initialize(v1, v2, v3);}
template <class T1, class T2, class T3, class T4>

2
mqv.h
View File

@ -30,7 +30,7 @@ public:
{m_groupParameters.Initialize(v1, v2);}
template <class T1, class T2, class T3>
MQV_Domain(T1 v1, T2 v2, T2 v3)
MQV_Domain(T1 v1, T2 v2, T3 v3)
{m_groupParameters.Initialize(v1, v2, v3);}
template <class T1, class T2, class T3, class T4>

View File

@ -101,7 +101,7 @@ public:
if (n < (unsigned int)MIN_KEYLENGTH)
return MIN_KEYLENGTH;
else if (n > (unsigned int)MAX_KEYLENGTH)
return MAX_KEYLENGTH;
return (unsigned int)MAX_KEYLENGTH;
else
{
n += KEYLENGTH_MULTIPLE-1;
@ -143,7 +143,7 @@ class SimpleKeyingInterfaceImpl : public BASE
{
public:
unsigned int MinKeyLength() const {return INFO::MIN_KEYLENGTH;}
unsigned int MaxKeyLength() const {return INFO::MAX_KEYLENGTH;}
unsigned int MaxKeyLength() const {return (unsigned int)INFO::MAX_KEYLENGTH;}
unsigned int DefaultKeyLength() const {return INFO::DEFAULT_KEYLENGTH;}
unsigned int GetValidKeyLength(unsigned int n) const {return INFO::StaticGetValidKeyLength(n);}
typename BASE::IV_Requirement IVRequirement() const {return (typename BASE::IV_Requirement)INFO::IV_REQUIREMENT;}
@ -179,7 +179,7 @@ public:
CheckedSetKey(this, DIR, key, length, param);
}
Clonable * Clone() {return new BlockCipherTemplate<DIR, BASE>(*this);}
Clonable * Clone() const {return new BlockCipherTemplate<DIR, BASE>(*this);}
};
//! .
@ -205,7 +205,7 @@ public:
CheckedSetKey(this, Empty(), key, length, param);
}
Clonable * Clone() {return new MessageAuthenticationCodeTemplate<BASE>(*this);}
Clonable * Clone() const {return new MessageAuthenticationCodeTemplate<BASE>(*this);}
};
// ************** documentation ***************

View File

@ -134,14 +134,14 @@ public:
{ChannelInitialize(NULL_CHANNEL, parameters, propagation);}
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
{return ChannelFlush(NULL_CHANNEL, hardFlush, propagation, blocking);}
void MessageSeriesEnd(int propagation)
{ChannelMessageSeriesEnd(NULL_CHANNEL, propagation);}
bool MessageSeriesEnd(int propagation=-1, bool blocking=true)
{return ChannelMessageSeriesEnd(NULL_CHANNEL, propagation, blocking);}
byte * CreatePutSpace(unsigned int &size)
{return ChannelCreatePutSpace(NULL_CHANNEL, size);}
unsigned int Put2(const byte *begin, unsigned int length, int messageEnd, bool blocking)
{return ChannelPut2(NULL_CHANNEL, begin, length, messageEnd, blocking);}
unsigned int PutModifiable2(byte *begin, byte *end, int messageEnd, bool blocking)
{return ChannelPutModifiable2(NULL_CHANNEL, begin, end, messageEnd, blocking);}
unsigned int PutModifiable2(byte *inString, unsigned int length, int messageEnd, bool blocking)
{return ChannelPutModifiable2(NULL_CHANNEL, inString, length, messageEnd, blocking);}
// void ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1)
// {PropagateMessageSeriesEnd(propagation, channel);}

View File

@ -36,9 +36,10 @@ NAMESPACE_BEGIN(CryptoPP)
template <class POLICY_INTERFACE, class BASE = Empty>
class AbstractPolicyHolder : public BASE
{
protected:
public:
typedef POLICY_INTERFACE PolicyInterface;
protected:
virtual const POLICY_INTERFACE & GetPolicy() const =0;
virtual POLICY_INTERFACE & AccessPolicy() =0;
};
@ -130,9 +131,9 @@ public:
bool IsRandomAccess() const {return GetPolicy().IsRandomAccess();}
void Seek(dword position);
protected:
typedef typename BASE::PolicyInterface PolicyInterface;
protected:
void UncheckedSetKey(const NameValuePairs &params, const byte *key, unsigned int length);
unsigned int GetBufferByteSize(const PolicyInterface &policy) const {return policy.GetBytesPerIteration() * policy.GetIterationsToBuffer();}
@ -220,9 +221,9 @@ public:
bool IsRandomAccess() const {return false;}
bool IsSelfInverting() const {return false;}
protected:
typedef typename BASE::PolicyInterface PolicyInterface;
protected:
virtual void CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, unsigned int length) =0;
void UncheckedSetKey(const NameValuePairs &params, const byte *key, unsigned int length);
@ -262,7 +263,7 @@ public:
UncheckedSetKey(params, key, length);
}
Clonable * Clone() {return new SymmetricCipherFinalTemplate<BASE, INFO>(*this);}
Clonable * Clone() const {return static_cast<SymmetricCipher *>(new SymmetricCipherFinalTemplate<BASE, INFO>(*this));}
};
template <class S>