minor changes

pull/2/head
weidai 2003-08-25 21:41:09 +00:00
parent 89862d1220
commit 93ba4e160f
5 changed files with 18 additions and 7 deletions

View File

@ -78,6 +78,7 @@ unsigned long Crop(unsigned long value, unsigned int size)
#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) #if !(defined(_MSC_VER) && (_MSC_VER < 1300))
using std::new_handler; using std::new_handler;
using std::set_new_handler;
#endif #endif
void CallNewHandler() void CallNewHandler()

View File

@ -7,6 +7,11 @@ NAMESPACE_BEGIN(CryptoPP)
template<> const byte EMSA2HashId<SHA>::id = 0x33; template<> const byte EMSA2HashId<SHA>::id = 0x33;
template<> const byte EMSA2HashId<RIPEMD160>::id = 0x31; template<> const byte EMSA2HashId<RIPEMD160>::id = 0x31;
template<> const byte EMSA2HashId<RIPEMD128>::id = 0x32;
template<> const byte EMSA2HashId<SHA256>::id = 0x34;
template<> const byte EMSA2HashId<SHA384>::id = 0x36;
template<> const byte EMSA2HashId<SHA512>::id = 0x35;
template<> const byte EMSA2HashId<Whirlpool>::id = 0x37;
unsigned int PSSR_MEM_Base::MaxRecoverableLength(unsigned int representativeBitLength, unsigned int hashIdentifierLength, unsigned int digestLength) const unsigned int PSSR_MEM_Base::MaxRecoverableLength(unsigned int representativeBitLength, unsigned int hashIdentifierLength, unsigned int digestLength) const
{ {

5
pssr.h
View File

@ -36,6 +36,11 @@ template <class H> struct EMSA2HashId
// EMSA2HashId can be instantiated with the following two classes. // EMSA2HashId can be instantiated with the following two classes.
class SHA; class SHA;
class RIPEMD160; class RIPEMD160;
class RIPEMD128;
class SHA256;
class SHA384;
class SHA512;
class Whirlpool;
template <class BASE> template <class BASE>
class EMSA2HashIdLookup : public BASE class EMSA2HashIdLookup : public BASE

2
rw.h
View File

@ -89,7 +89,7 @@ public:
}; };
//! EMSA2, for use with RW //! EMSA2, for use with RW
/*! The following hash functions are supported: SHA, RIPEMD160. */ /*! See pssr.h for a list of hash functions supported by this signature standard. */
struct P1363_EMSA2 : public SignatureStandard struct P1363_EMSA2 : public SignatureStandard
{ {
typedef EMSA2Pad SignatureMessageEncodingMethod; typedef EMSA2Pad SignatureMessageEncodingMethod;

View File

@ -18,7 +18,7 @@ inline CipherDir ReverseCipherDir(CipherDir dir)
//! . //! .
template <unsigned int N> template <unsigned int N>
class CRYPTOPP_DLL FixedBlockSize class FixedBlockSize
{ {
public: public:
enum {BLOCKSIZE = N}; enum {BLOCKSIZE = N};
@ -28,7 +28,7 @@ public:
//! . //! .
template <unsigned int R> template <unsigned int R>
class CRYPTOPP_DLL FixedRounds class FixedRounds
{ {
public: public:
enum {ROUNDS = R}; enum {ROUNDS = R};
@ -47,7 +47,7 @@ protected:
//! . //! .
template <unsigned int D, unsigned int N=1, unsigned int M=INT_MAX> // use INT_MAX here because enums are treated as signed ints template <unsigned int D, unsigned int N=1, unsigned int M=INT_MAX> // use INT_MAX here because enums are treated as signed ints
class CRYPTOPP_DLL VariableRounds class VariableRounds
{ {
public: public:
enum {DEFAULT_ROUNDS = D, MIN_ROUNDS = N, MAX_ROUNDS = M}; enum {DEFAULT_ROUNDS = D, MIN_ROUNDS = N, MAX_ROUNDS = M};
@ -74,7 +74,7 @@ protected:
//! . //! .
template <unsigned int N, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> template <unsigned int N, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
class CRYPTOPP_DLL FixedKeyLength class FixedKeyLength
{ {
public: public:
enum {KEYLENGTH=N, MIN_KEYLENGTH=N, MAX_KEYLENGTH=N, DEFAULT_KEYLENGTH=N}; enum {KEYLENGTH=N, MIN_KEYLENGTH=N, MAX_KEYLENGTH=N, DEFAULT_KEYLENGTH=N};
@ -84,7 +84,7 @@ public:
/// support query of variable key length, template parameters are default, min, max, multiple (default multiple 1) /// support query of variable key length, template parameters are default, min, max, multiple (default multiple 1)
template <unsigned int D, unsigned int N, unsigned int M, unsigned int Q = 1, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> template <unsigned int D, unsigned int N, unsigned int M, unsigned int Q = 1, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
class CRYPTOPP_DLL VariableKeyLength class VariableKeyLength
{ {
// make these private to avoid Doxygen documenting them in all derived classes // make these private to avoid Doxygen documenting them in all derived classes
CRYPTOPP_COMPILE_ASSERT(Q > 0); CRYPTOPP_COMPILE_ASSERT(Q > 0);
@ -112,7 +112,7 @@ public:
/// support query of key length that's the same as another class /// support query of key length that's the same as another class
template <class T> template <class T>
class CRYPTOPP_DLL SameKeyLengthAs class SameKeyLengthAs
{ {
public: public:
enum {MIN_KEYLENGTH=T::MIN_KEYLENGTH, MAX_KEYLENGTH=T::MAX_KEYLENGTH, DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH}; enum {MIN_KEYLENGTH=T::MIN_KEYLENGTH, MAX_KEYLENGTH=T::MAX_KEYLENGTH, DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH};