exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

msvc5.txt

msvc5.txt
Posted Dec 21, 1999

msvc5.txt

tags | encryption
SHA-256 | 94e474eb301212b3d3e573c3a1846d0d94ee0dbb05273a724bc09efd190eb93c

msvc5.txt

Change Mirror Download
Crypto++ 3.0 Porting Note to Visual C++ 5.0 (SP3)

Summary:
VC 5 cannot handle the CryptoPP namespace properly, and crashes upon
compilation. A workaround has been designed to create a macro called
PARTIAL_NAMESPACE. This will cause the CryptoPP namespace to not exist, but
the code will still use the std:: namespace for all Standard library stuff.

VC 5 also chokes on a couple of classes that derive with templates, and
these are fixed via a simple typedef as used per the Crypto++ 2.3
libraries.

Code changes:

-----------------------------------------------------------
File config.h --
-----------------------------------------------------------

Below:
#ifdef __GNUC__
#define NO_NAMESPACE
#endif


Add the following lines of code:
#if (_MSC_VER == 1100) || defined(__BORLANDC__) //MSVC version 5.0 or
//C++ Builder
#define PARTIAL_NAMESPACE
#endif


Locate:
#ifdef NO_NAMESPACE
#define std
#define CryptoPP
#define USING_NAMESPACE(x)
#define NAMESPACE_BEGIN(x)
#define NAMESPACE_END
#define ANONYMOUS_NAMESPACE_BEGIN
#else
#define USING_NAMESPACE(x) using namespace x;
#define USING_NAMESPACE_STD using namespace std;
#define NAMESPACE_BEGIN(x) namespace x {
#define ANONYMOUS_NAMESPACE_BEGIN namespace {
#define NAMESPACE_END }
#endif

And change it to:
#ifdef NO_NAMESPACE
#define std
#define CryptoPP
#define USING_NAMESPACE(x)
#define NAMESPACE_BEGIN(x)
#define NAMESPACE_END
#define ANONYMOUS_NAMESPACE_BEGIN
#define USING_NAMESPACE_STD
#elif defined PARTIAL_NAMESPACE
#define CryptoPP
#define USING_NAMESPACE(x)
#define USING_NAMESPACE_STD using namespace std;
#define NAMESPACE_BEGIN(x)
#define NAMESPACE_END
#define ANONYMOUS_NAMESPACE_BEGIN
#else
#define USING_NAMESPACE(x) using namespace x;
#define USING_NAMESPACE_STD using namespace std;
#define NAMESPACE_BEGIN(x) namespace x {
#define ANONYMOUS_NAMESPACE_BEGIN namespace {
#define NAMESPACE_END }
#endif

-----------------------------------------------------------
File ECC Crypto.h --
-----------------------------------------------------------
At the top of the file:

Below:
template <class T> class EcPrecomputation;

Add the lines:
typedef PK_WithPrecomputation<PK_FixedLengthEncryptor> PKWPFLE;
typedef PK_WithPrecomputation<DigestVerifier> PKWDV;

Change the line
template <class EC>
class ECPublicKey : public PK_WithPrecomputation<PK_FixedLengthEncryptor>,
public PK_WithPrecomputation<DigestVerifier>

to
template <class EC>
class ECPublicKey : public PKWPFLE, public PKWDV


-----------------------------------------------------------
-----------------------------------------------------------

That's it for the main library. To compile the test executable, perform the
following changes:

-----------------------------------------------------------
Files bench.cpp, test.cpp, validat1.cpp, validat2.cpp, validat3.cpp --
-----------------------------------------------------------
Change the line near the top of the file that reads:

USING_NAMESPACE(std)

to

USING_NAMESPACE_STD


-----------------------------------------------------------
***OPTIONAL***
-----------------------------------------------------------
You might want to grep the entire project and replace all occurances of
Exception with CryptlibException (which was the name for it in the 2.3
release) this way since there is no CryptoPP:: namespace wrapper over the
name Exception, you run less of a chance of conflicting with another
company's "Exception" class.
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close