don't do namespace hack

This commit is contained in:
Glenn Maynard
2006-02-03 19:58:38 +00:00
parent 61f5eeb5e5
commit 0cb1e5e337
43 changed files with 89 additions and 89 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
#include <vector>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
template <class T> const T& AbstractGroup<T>::Double(const Element &a) const
{
@@ -337,4 +337,4 @@ void AbstractRing<T>::SimultaneousExponentiate(T *results, const T &base, const
MultiplicativeGroup().AbstractGroup<T>::SimultaneousMultiply(results, base, exponents, expCount);
}
NAMESPACE_END
}
+2 -2
View File
@@ -3,7 +3,7 @@
#include "config.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
class Integer;
@@ -270,6 +270,6 @@ protected:
Element m_modulus;
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -3,8 +3,8 @@
#include "pch.h"
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
bool (*AssignIntToInteger)(const std::type_info &valueType, void *pInteger, const void *pInt) = NULL;
NAMESPACE_END
}
+2 -2
View File
@@ -5,7 +5,7 @@
#include "smartptr.h"
#include "secblock.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! used to pass byte array input as part of a NameValuePairs object
/*! the deepCopy option is used when the NameValuePairs object can't
@@ -320,6 +320,6 @@ AlgorithmParameters<NullNameValuePairs,T> MakeParameters(const char *name, const
#define CRYPTOPP_SET_FUNCTION_ENTRY(name) (Name::name(), &ThisClass::Set##name)
#define CRYPTOPP_SET_FUNCTION_ENTRY2(name1, name2) (Name::name1(), Name::name2(), &ThisClass::Set##name1##And##name2)
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#include "cryptlib.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
DOCUMENTED_NAMESPACE_BEGIN(Name)
@@ -49,6 +49,6 @@ CRYPTOPP_DEFINE_NAME_STRING(XMACC_Counter) //!< word32
DOCUMENTED_NAMESPACE_END
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -6,7 +6,7 @@
#include <iomanip>
#include <time.h>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
USING_NAMESPACE(std)
/// DER Length
@@ -553,4 +553,4 @@ void PKCS8PrivateKey::DEREncode(BufferedTransformation &bt) const
privateKeyInfo.MessageEnd();
}
NAMESPACE_END
}
+1 -1
View File
@@ -5,7 +5,7 @@
#include "queue.h"
#include <vector>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
// these tags and flags are not complete
enum ASNTag
+2 -2
View File
@@ -107,7 +107,7 @@
typedef unsigned char byte; // moved outside namespace for Borland C++Builder 5
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
typedef unsigned short word16;
#if defined(__alpha) && !defined(_MSC_VER)
@@ -178,7 +178,7 @@ union dword_union
# define FAST_ROTATE
#endif
NAMESPACE_END
}
// VC60 workaround: it doesn't allow typename in some places
#if defined(_MSC_VER) && (_MSC_VER < 1300)
+2 -2
View File
@@ -9,7 +9,7 @@
#include <memory>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//CRYPTOPP_COMPILE_ASSERT(sizeof(byte) == 1);
//CRYPTOPP_COMPILE_ASSERT(sizeof(word32) == 4);
@@ -648,4 +648,4 @@ DecodingResult PK_Verifier::RecoverMessage(byte *recoveredMessage,
return RecoverAndRestart(recoveredMessage, *m);
}
NAMESPACE_END
}
+1 -1
View File
@@ -62,7 +62,7 @@ and getting me started with this manual.
#include <typeinfo>
#include <assert.h>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
// forward declarations
class Integer;
+2 -2
View File
@@ -3,7 +3,7 @@
#include "pch.h"
#include "files.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
using namespace std;
@@ -184,4 +184,4 @@ unsigned int FileSink::Put2(const byte *inString, unsigned int length, int messa
return 0;
}
NAMESPACE_END
}
+2 -2
View File
@@ -7,7 +7,7 @@
#include <iostream>
#include <fstream>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! .
class FileStore : public Store, private FilterPutSpaceHelper
@@ -90,6 +90,6 @@ private:
std::ostream *m_stream;
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -7,7 +7,7 @@
#include "argnames.h"
#include <functional>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
Filter::Filter(BufferedTransformation *attachment)
: m_attachment(attachment), m_continueAt(0)
@@ -605,4 +605,4 @@ unsigned int StringStore::CopyRangeTo2(BufferedTransformation &target, unsigned
return blockedBytes;
}
NAMESPACE_END
}
+2 -2
View File
@@ -8,7 +8,7 @@
#include "queue.h"
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
/// provides an implementation of BufferedTransformation's attachment interface
class Filter : public BufferedTransformation, public NotCopyable
@@ -532,6 +532,6 @@ public:
: SourceTemplate<StringStore>(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));}
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -20,7 +20,7 @@
#include "algebra.cpp"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
bool FunctionAssignIntToInteger(const std::type_info &valueType, void *pInteger, const void *pInt)
{
@@ -3914,4 +3914,4 @@ const Integer& MontgomeryRepresentation::MultiplicativeInverse(const Integer &a)
template class AbstractRing<Integer>;
NAMESPACE_END
}
+3 -3
View File
@@ -21,7 +21,7 @@
# endif
#endif
*/
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
#ifdef SSE2_INTRINSICS_AVAILABLE
template <class T>
@@ -412,13 +412,13 @@ inline CryptoPP::Integer operator/(const CryptoPP::Integer &a, CryptoPP::word b)
//!
inline CryptoPP::word operator%(const CryptoPP::Integer &a, CryptoPP::word b) {return a.Modulo(b);}
NAMESPACE_END
}
NAMESPACE_BEGIN(std)
template<> inline void swap(CryptoPP::Integer &a, CryptoPP::Integer &b)
{
a.swap(b);
}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
#include "iterhash.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
template <class T, class BASE>
IteratedHashBase<T, BASE>::IteratedHashBase(unsigned int blockSize,
@@ -120,4 +120,4 @@ template class IteratedHashBase<word64, MessageAuthenticationCode>;
template class IteratedHashBase<word32, HashTransformation>;
template class IteratedHashBase<word32, MessageAuthenticationCode>;
NAMESPACE_END
}
+2 -2
View File
@@ -5,7 +5,7 @@
#include "secblock.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
template <class T, class BASE>
class IteratedHashBase : public BASE
@@ -116,6 +116,6 @@ template <class T, class B, class BASE> void IteratedHashBase2<T, B, BASE>::Hash
}
}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
#include "misc.h"
#include "words.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
byte OAEP_P_DEFAULT[1];
@@ -80,4 +80,4 @@ unsigned long Crop(unsigned long value, unsigned int size)
return value;
}
NAMESPACE_END
}
+2 -2
View File
@@ -12,7 +12,7 @@
#include <stdlib.h>
#endif
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
// ************** compile-time assertion ***************
@@ -520,6 +520,6 @@ inline T SafeLeftShift(T value)
return SafeShifter<(bits>=(8*sizeof(T)))>::LeftShift(value, bits);
}
NAMESPACE_END
}
#endif // MISC_H
+2 -2
View File
@@ -8,7 +8,7 @@
#include "integer.h"
#include "algebra.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! .
class ModularArithmetic : public AbstractRing<Integer>
@@ -145,6 +145,6 @@ private:
mutable SecAlignedWordBlock workspace;
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#include "pch.h"
#include "mqueue.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
MessageQueue::MessageQueue(unsigned int nodeSize)
: m_queue(nodeSize), m_lengths(1, 0U), m_messageCounts(1, 0U)
@@ -68,4 +68,4 @@ const byte * MessageQueue::Spy(unsigned int &contiguousSize) const
// *************************************************************
NAMESPACE_END
}
+3 -3
View File
@@ -5,7 +5,7 @@
#include "filters.h"
#include <deque>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! Message Queue
class MessageQueue : public AutoSignaling<BufferedTransformation>
@@ -61,13 +61,13 @@ private:
};
NAMESPACE_END
}
NAMESPACE_BEGIN(std)
template<> inline void swap(CryptoPP::MessageQueue &a, CryptoPP::MessageQueue &b)
{
a.swap(b);
}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -8,7 +8,7 @@
#include <math.h>
#include <vector>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
const unsigned int maxPrimeTableSize = 3511; // last prime 32719
const word lastSmallPrime = 32719;
@@ -730,4 +730,4 @@ unsigned int DiscreteLogWorkFactor(unsigned int n)
}
NAMESPACE_END
}
+2 -2
View File
@@ -6,7 +6,7 @@
#include "integer.h"
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
// export a table of small primes
extern const unsigned int maxPrimeTableSize;
@@ -104,6 +104,6 @@ bool SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, c
unsigned int DiscreteLogWorkFactor(unsigned int bitlength);
unsigned int FactoringWorkFactor(unsigned int bitlength);
NAMESPACE_END
}
#endif
+3 -3
View File
@@ -5,7 +5,7 @@
#include "asn.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
NAMESPACE_BEGIN(ASN1)
@@ -105,8 +105,8 @@ DEFINE_OID(2, joint_iso_ccitt)
DEFINE_OID(nist_hashalgs()+2, id_sha384)
DEFINE_OID(nist_hashalgs()+3, id_sha512)
NAMESPACE_END
}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -21,7 +21,7 @@
#include <unistd.h>
#endif
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
#if defined(NONBLOCKING_RNG_AVAILABLE) || defined(BLOCKING_RNG_AVAILABLE)
OS_RNG_Err::OS_RNG_Err(const std::string &operation)
@@ -99,6 +99,6 @@ void NonblockingRng::GenerateBlock(byte *output, unsigned int size)
#endif
}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -10,7 +10,7 @@
#include "cryptlib.h"
#include "filters.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! Exception class for Operating-System Random Number Generator.
class OS_RNG_Err : public Exception
@@ -55,6 +55,6 @@ protected:
#endif
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
#include "pkcspad.h"
#include <assert.h>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
template<> const byte PKCS_DigestDecoration<SHA>::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14};
template<> const unsigned int PKCS_DigestDecoration<SHA>::length = sizeof(PKCS_DigestDecoration<SHA>::decoration);
@@ -41,4 +41,4 @@ void PKCS1v15_SignatureMessageEncodingMethod::ComputeMessageRepresentative(Rando
hash.Final(pDigest);
}
NAMESPACE_END
}
+2 -2
View File
@@ -4,7 +4,7 @@
#include "cryptlib.h"
#include "pubkey.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! <a href="http://www.weidai.com/scan-mirror/ca.html#cem_PKCS1-1.5">EME-PKCS1-v1_5</a>
@@ -46,6 +46,6 @@ struct PKCS1v15 : public SignatureStandard
class SHA;
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#include "pch.h"
#include "pubkey.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
void P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, unsigned int outputLength, const byte *input, unsigned int inputLength, bool mask, unsigned int counterStart)
{
@@ -99,4 +99,4 @@ DecodingResult TF_VerifierBase::RecoverAndRestart(byte *recoveredMessage, PK_Mes
return result;
}
NAMESPACE_END
}
+2 -2
View File
@@ -42,7 +42,7 @@
// VC60 workaround: this macro is defined in shlobj.h and conflicts with a template parameter used in this file
#undef INTERFACE
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
Integer NR_EncodeDigest(unsigned int modulusBits, const byte *digest, unsigned int digestLen);
Integer DSA_EncodeDigest(unsigned int modulusBits, const byte *digest, unsigned int digestLen);
@@ -597,6 +597,6 @@ public:
typedef PK_FinalTemplate<TF_VerifierImpl<SchemeOptions> > Verifier;
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
#include "queue.h"
#include "filters.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
// this class for use by ByteQueue only
class ByteQueueNode
@@ -515,4 +515,4 @@ unsigned int ByteQueue::Walker::CopyRangeTo2(BufferedTransformation &target, uns
return blockedBytes;
}
NAMESPACE_END
}
+3 -3
View File
@@ -6,7 +6,7 @@
#include "simple.h"
//#include <algorithm>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
/** The queue is implemented as a linked list of byte arrays, but you don't need to
know about that. So just ignore this next line. :) */
@@ -116,13 +116,13 @@ private:
ByteQueue &m_bq;
};
NAMESPACE_END
}
NAMESPACE_BEGIN(std)
template<> inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b)
{
a.swap(b);
}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -10,7 +10,7 @@
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
OID RSAFunction::GetAlgorithmID() const
@@ -232,4 +232,4 @@ void InvertibleRSAFunction::AssignFrom(const NameValuePairs &source)
;
}
NAMESPACE_END
}
+2 -2
View File
@@ -10,7 +10,7 @@
#include "integer.h"
#include "asn.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! .
class RSAFunction : public TrapdoorFunction, public X509PublicKey
@@ -118,6 +118,6 @@ struct RSASS : public TF_SS<STANDARD, H, RSA>
typedef RSASS<PKCS1v15, SHA>::Signer RSASSA_PKCS1v15_SHA_Signer;
typedef RSASS<PKCS1v15, SHA>::Verifier RSASSA_PKCS1v15_SHA_Verifier;
NAMESPACE_END
}
#endif
+3 -3
View File
@@ -8,7 +8,7 @@
#include <string.h> // CodeWarrior doesn't have memory.h
#include <assert.h>
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
// ************** secure memory allocation ***************
@@ -365,7 +365,7 @@ inline bool operator==(const CryptoPP::AllocatorWithCleanup<T>&, const CryptoPP:
template<class T, class U>
inline bool operator!=(const CryptoPP::AllocatorWithCleanup<T>&, const CryptoPP::AllocatorWithCleanup<U>&) {return (false);}
NAMESPACE_END
}
NAMESPACE_BEGIN(std)
template <class T, class A>
@@ -383,6 +383,6 @@ __stl_alloc_rebind(CryptoPP::AllocatorWithCleanup<_Tp1>& __a, const _Tp2*)
}
#endif
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -9,7 +9,7 @@
#include "misc.h"
#include "simple.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
//! .
template <unsigned int N>
@@ -105,6 +105,6 @@ struct SymmetricCipherDocumentation
typedef SymmetricCipher Decryption;
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -7,7 +7,7 @@
#include "sha.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
void SHA::Init()
{
@@ -80,4 +80,4 @@ void SHA::Transform(word32 *state, const word32 *data)
// *************************************************************
NAMESPACE_END
}
+2 -2
View File
@@ -3,7 +3,7 @@
#include "iterhash.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
/// <a href="http://www.weidai.com/scan-mirror/md.html#SHA-1">SHA-1</a>
class SHA : public IteratedHashWithStaticTransform<word32, BigEndian, 64, SHA>
@@ -20,6 +20,6 @@ protected:
typedef SHA SHA1;
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -9,7 +9,7 @@
#include "cryptlib.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
template <class BASE, class ALGORITHM_INFO = BASE>
class AlgorithmImpl : public BASE
@@ -185,6 +185,6 @@ public:
{return 0;}
};
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#include "config.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
template<class T> class member_ptr
{
@@ -40,6 +40,6 @@ protected:
template <class T> member_ptr<T>::~member_ptr() {delete m_p;}
template <class T> void member_ptr<T>::reset(T *p) {delete m_p; m_p = p;}
NAMESPACE_END
}
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
namespace CryptoPP {
inline unsigned int CountWords(const word *X, unsigned int N)
{
@@ -98,6 +98,6 @@ inline void ShiftWordsRightByWords(word *r, unsigned int n, unsigned int shiftWo
}
}
NAMESPACE_END
}
#endif