merge changes from 5.0.4

import/raw
weidai 2003-09-05 00:57:04 +00:00
parent 597f3ee35e
commit 06206ea4e1
3 changed files with 91 additions and 38 deletions

View File

@ -1,4 +1,4 @@
Crypto++: a C++ Class Library of Cryptographic Primitives Crypto++: a C++ Class Library of Cryptographic Schemes
Version 5.2 (in development) Version 5.2 (in development)
This library includes: This library includes:
@ -48,25 +48,78 @@ This library includes:
You are welcome to use it for any purpose without paying me, but see You are welcome to use it for any purpose without paying me, but see
license.txt for the fine print. license.txt for the fine print.
This version of Crypto++ has been compiled successfully with MSVC 6.0 This version of Crypto++ has been compiled successfully with MSVC 6.0, .NET
and 7.0 on Windows XP, GCC 2.95.4 on FreeBSD 4.6, GCC 2.95.3 on 2002, and .NET 2003 on Windows XP, GCC 2.95.4 on FreeBSD 4.6, GCC 2.95.3 on
Linux 2.4 and SunOS 5.8, GCC 3.2 on Cygwin 1.3.12, and Metrowerks Linux 2.4 and SunOS 5.8, GCC 3.2 on Cygwin 1.3.12, and Metrowerks
CodeWarrior 8.2. CodeWarrior 8.2.
*** MSVC-Specific Information ***
On Windows, Crypto++ can be compiled into 3 forms: a static library
including all algorithms, a DLL with only FIPS Approved algorithms, and
a static library with only algorithms not in the DLL.
(FIPS Approved means Approved according to the FIPS 140-2 standard.)
The DLL may be used by itself, or it may be used together with the second
form of the static library. MSVC project files are included to build
all three forms, and sample applications using each of the three forms
are also included.
To compile Crypto++ with MSVC, open the "cryptest.dsw" workspace file To compile Crypto++ with MSVC, open the "cryptest.dsw" workspace file
and build the "cryptest" project. This will compile Crypto++ as a static and build one or more of the following projects:
library and also build the test driver. Run the test driver and make sure
the validation suite passes. Then to use the library simply insert the cryptdll - This builds the DLL. Please note that if you wish to use Crypto++
"cryptlib.dsp" project file into your own application workspace as a as a FIPS validated module, you must use a pre-built DLL that has undergone
dependent project. You should check the compiler options to make sure the FIPS validation process instead of building your own.
that the library and your application are using the same C++ run-time dlltest - This builds a sample application that only uses the DLL.
libraries and calling conventions. cryptest Non-DLL-Import Configuration - This builds the full static library
along with a full test driver.
cryptest DLL-Import Configuration - This builds a static library containing
only algorithms not in the DLL, along with a full test driver that uses
both the DLL and the static library.
To use the Crypto++ DLL in your application, #include "dll.h" before including
any other Crypto++ header files, and place the DLL in the same directory as
your .exe file. dll.h includes the line #pragma comment(lib, "cryptopp")
so you don't have to explicitly list the import library in your project
settings. To use a static library form of Crypto++, specify it as
an additional library to link with in your project settings.
In either case you should check the compiler options to
make sure that the library and your application are using the same C++
run-time libraries and calling conventions.
*** DLL Memory Management ***
Because it's possible for the Crypto++ DLL to delete objects allocated
by the calling application, they must use the same C++ memory heap. Three
methods are provided to achieve this.
1. The calling application can tell Crypto++ what heap to use. This method
is required when the calling application uses a non-standard heap.
2. Crypto++ can tell the calling application what heap to use. This method
is required when the calling application uses a statically linked C++ Run
Time Library. (Method 1 does not work in this case because the Crypto++ DLL
is initialized before the calling application's heap is initialized.)
3. Crypto++ can automatically use the heap provided by the calling application's
dynamically linked C++ Run Time Library. The calling application must
make sure that the dynamically linked C++ Run Time Library is initialized
before Crypto++ is loaded. (At this time it is not clear if it is possible
to control the order in which DLLs are initialized on Windows 9x machines,
so it might be best to avoid using this method.)
When Crypto++ attaches to a new process, it searches all modules loaded
into the process space for exported functions "GetNewAndDeleteForCryptoPP"
and "SetNewAndDeleteFromCryptoPP". If one of these functions is found,
Crypto++ uses methods 1 or 2, respectively, by calling the function.
Otherwise, method 3 is used.
*** GCC-Specific Information ***
A makefile is included for you to compile Crypto++ with GCC. Make sure A makefile is included for you to compile Crypto++ with GCC. Make sure
you are using GNU Make and GNU ld. The make process will produce two files, you are using GNU Make and GNU ld. The make process will produce two files,
libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the validation libcryptopp.a and cryptest.exe. Run "cryptest.exe v" for the validation
suite. suite.
*** Documentation and Support ***
Crypto++ is documented through inline comments in header files, which are Crypto++ is documented through inline comments in header files, which are
processed through Doxygen to produce an HTML reference manual. You can find processed through Doxygen to produce an HTML reference manual. You can find
a link to the manual from http://www.cryptopp.com. Also at that site is a link to the manual from http://www.cryptopp.com. Also at that site is
@ -80,7 +133,7 @@ http://www.cryptopp.com. You can also email me directly at
cryptopp@weidai.com, but you will probably get a faster response through cryptopp@weidai.com, but you will probably get a faster response through
the mailing list. the mailing list.
Finally, a couple of usage notes to keep in mind: *** Important Usage Notes ***
1. If a constructor for A takes a pointer to an object B (except primitive 1. If a constructor for A takes a pointer to an object B (except primitive
types such as int and char), then A owns B and will delete B at A's types such as int and char), then A owns B and will delete B at A's
@ -92,9 +145,7 @@ A no longer needs it.
Crypto++ safely in a multithreaded application, but you must provide Crypto++ safely in a multithreaded application, but you must provide
synchronization when multiple threads access a common Crypto++ object. synchronization when multiple threads access a common Crypto++ object.
Wei Dai *** History ***
History
1.0 - First public release. Withdrawn at the request of RSA DSI. 1.0 - First public release. Withdrawn at the request of RSA DSI.
- included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA, - included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA,
@ -267,3 +318,5 @@ History
with public key encryption (implemented by OAEP and DL/ECIES) with public key encryption (implemented by OAEP and DL/ECIES)
- added Camellia, SHACAL-2, Two-Track-MAC, Whirlpool, RIPEMD-320, - added Camellia, SHACAL-2, Two-Track-MAC, Whirlpool, RIPEMD-320,
RIPEMD-128, RIPEMD-256, Base 32 coding RIPEMD-128, RIPEMD-256, Base 32 coding
Written by Wei Dai

View File

@ -17,8 +17,8 @@ CFG=cryptest - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "cryptest - Win32 FIPS 140 Release" (based on "Win32 (x86) Console Application") !MESSAGE "cryptest - Win32 DLL-Import Release" (based on "Win32 (x86) Console Application")
!MESSAGE "cryptest - Win32 FIPS 140 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "cryptest - Win32 DLL-Import Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "cryptest - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "cryptest - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "cryptest - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "cryptest - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE !MESSAGE
@ -30,7 +30,7 @@ CFG=cryptest - Win32 Debug
CPP=cl.exe CPP=cl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "cryptest - Win32 FIPS 140 Release" !IF "$(CFG)" == "cryptest - Win32 DLL-Import Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@ -40,8 +40,8 @@ RSC=rc.exe
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir "CT_FIPS_140_Release" # PROP Output_Dir "CT_DLL_Import_Release"
# PROP Intermediate_Dir "CT_FIPS_140_Release" # PROP Intermediate_Dir "CT_DLL_Import_Release"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c # ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c
@ -60,7 +60,7 @@ SOURCE="$(InputPath)"
PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build it yourself using the cryptdll project, or echo obtain a pre-built, FIPS 140-2 validated DLL. If you build it yourself echo the resulting DLL will not be considered FIPS validated echo unless it undergoes FIPS validation. PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build it yourself using the cryptdll project, or echo obtain a pre-built, FIPS 140-2 validated DLL. If you build it yourself echo the resulting DLL will not be considered FIPS validated echo unless it undergoes FIPS validation.
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "cryptest - Win32 FIPS 140 Debug" !ELSEIF "$(CFG)" == "cryptest - Win32 DLL-Import Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
@ -70,8 +70,8 @@ PreLink_Cmds=echo This configuration requires cryptopp.dll. echo You can build i
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "CT_FIPS_140_Debug" # PROP Output_Dir "CT_DLL_Import_Debug"
# PROP Intermediate_Dir "CT_FIPS_140_Debug" # PROP Intermediate_Dir "CT_DLL_Import_Debug"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /Zm200 /c
@ -143,8 +143,8 @@ LINK32=link.exe
# Begin Target # Begin Target
# Name "cryptest - Win32 FIPS 140 Release" # Name "cryptest - Win32 DLL-Import Release"
# Name "cryptest - Win32 FIPS 140 Debug" # Name "cryptest - Win32 DLL-Import Debug"
# Name "cryptest - Win32 Release" # Name "cryptest - Win32 Release"
# Name "cryptest - Win32 Debug" # Name "cryptest - Win32 Debug"
# Begin Group "Test Data" # Begin Group "Test Data"

View File

@ -17,8 +17,8 @@ CFG=cryptlib - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "cryptlib - Win32 FIPS 140 Release" (based on "Win32 (x86) Static Library") !MESSAGE "cryptlib - Win32 DLL-Import Release" (based on "Win32 (x86) Static Library")
!MESSAGE "cryptlib - Win32 FIPS 140 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "cryptlib - Win32 DLL-Import Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "cryptlib - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "cryptlib - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "cryptlib - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "cryptlib - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
@ -30,7 +30,7 @@ CFG=cryptlib - Win32 Debug
CPP=cl.exe CPP=cl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "cryptlib - Win32 FIPS 140 Release" !IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@ -39,11 +39,11 @@ RSC=rc.exe
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir "FIPS_140_Release" # PROP Output_Dir "DLL_Import_Release"
# PROP Intermediate_Dir "FIPS_140_Release" # PROP Intermediate_Dir "DLL_Import_Release"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c # ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c
# ADD CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /Fd"FIPS_140_Release/cryptopp" /FD /c # ADD CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /c
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe
@ -53,7 +53,7 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo # ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "cryptlib - Win32 FIPS 140 Debug" !ELSEIF "$(CFG)" == "cryptlib - Win32 DLL-Import Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
@ -62,11 +62,11 @@ LIB32=link.exe -lib
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "FIPS_140_Debug" # PROP Output_Dir "DLL_Import_Debug"
# PROP Intermediate_Dir "FIPS_140_Debug" # PROP Intermediate_Dir "DLL_Import_Debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c
# ADD CPP /nologo /G5 /Gz /MTd /W3 /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /Fd"FIPS_140_Debug/cryptopp" /FD /c # ADD CPP /nologo /G5 /Gz /MTd /W3 /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /c
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe
@ -126,8 +126,8 @@ LIB32=link.exe -lib
# Begin Target # Begin Target
# Name "cryptlib - Win32 FIPS 140 Release" # Name "cryptlib - Win32 DLL-Import Release"
# Name "cryptlib - Win32 FIPS 140 Debug" # Name "cryptlib - Win32 DLL-Import Debug"
# Name "cryptlib - Win32 Release" # Name "cryptlib - Win32 Release"
# Name "cryptlib - Win32 Debug" # Name "cryptlib - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
@ -141,7 +141,7 @@ SOURCE=.\3way.cpp
SOURCE=.\adhoc.cpp.proto SOURCE=.\adhoc.cpp.proto
!IF "$(CFG)" == "cryptlib - Win32 FIPS 140 Release" !IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release"
# Begin Custom Build # Begin Custom Build
InputPath=.\adhoc.cpp.proto InputPath=.\adhoc.cpp.proto
@ -152,7 +152,7 @@ InputPath=.\adhoc.cpp.proto
# End Custom Build # End Custom Build
!ELSEIF "$(CFG)" == "cryptlib - Win32 FIPS 140 Debug" !ELSEIF "$(CFG)" == "cryptlib - Win32 DLL-Import Debug"
# Begin Custom Build # Begin Custom Build
InputPath=.\adhoc.cpp.proto InputPath=.\adhoc.cpp.proto