compile cryptlib files in the main project - not in a separate lib

This commit is contained in:
Chris Danford
2004-02-14 11:13:23 +00:00
parent 7bb3752901
commit ba72d9e341
6 changed files with 500 additions and 42 deletions
+17 -12
View File
@@ -4,23 +4,28 @@
#include "channels.h"
#include "rsa.h"
#include "md5.h"
#include "randpool.h"
#include <memory>
/* Pull in crypt library here. */
#ifdef _XBOX
// FIXME
#elif defined _WINDOWS
#ifdef DEBUG
#pragma comment(lib, "crypto51/cryptlibd.lib")
#else
#pragma comment(lib, "crypto51/cryptlib.lib")
#endif
#endif
using namespace CryptoPP;
using namespace std;
void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed)
{
RandomPool randPool;
randPool.Put((byte *)seed, strlen(seed));
RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
HexEncoder privFile(new FileSink(privFilename));
priv.DEREncode(privFile);
privFile.MessageEnd();
RSAES_OAEP_SHA_Encryptor pub(priv);
HexEncoder pubFile(new FileSink(pubFilename));
pub.DEREncode(pubFile);
pubFile.MessageEnd();
}
void RSASignFile(const char *privFilename, const char *messageFilename, const char *signatureFilename)
{
FileSource privFile(privFilename, true, new HexDecoder);
+4 -1
View File
@@ -209,9 +209,12 @@ LightsManager.cpp LightsManager.h MemoryCardManager.cpp MemoryCardManager.h Note
ProfileManager.cpp ProfileManager.h ScreenManager.cpp ScreenManager.h SongManager.cpp SongManager.h ThemeManager.cpp ThemeManager.h \
UnlockSystem.cpp UnlockSystem.h
cryptlib = \
crypto51\algparam.cpp crypto51\asn.cpp crypto51\basecode.cpp crypto51\channels.cpp crypto51\cryptlib.cpp crypto51\des.cpp crypto51\dessp.cpp crypto51\files.cpp crypto51\filters.cpp crypto51\fips140.cpp crypto51\hex.cpp crypto51\integer.cpp crypto51\iterhash.cpp crypto51\md5.cpp crypto51\misc.cpp crypto51\modes.cpp crypto51\mqueue.cpp crypto51\nbtheory.cpp crypto51\pkcspad.cpp crypto51\pssr.cpp crypto51\pubkey.cpp crypto51\queue.cpp crypto51\randpool.cpp crypto51\rsa.cpp crypto51\sha.cpp crypto51\strciphr.cpp
stepmania_SOURCES = $(Screens) $(DataStructures) $(FileTypes) $(StepMania) $(Arch) \
$(ActorsInGameplayAndMenus) $(ActorsInMenus) $(ActorsInGameplay) \
$(Rage) $(Actors) $(GlobalSingletons)
$(Rage) $(Actors) $(GlobalSingletons) $(cryptlib)
stepmania_LDADD = \
$(GL_LIBS) \
+396 -2
View File
@@ -65,7 +65,7 @@ IntDir=.\../Debug6
TargetDir=\stepmania\itg\Program
TargetName=StepMania-debug
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool
@@ -142,7 +142,7 @@ IntDir=.\../Release6
TargetDir=\stepmania\stepmania\Program
TargetName=StepMania
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool
@@ -6097,6 +6097,400 @@ SOURCE=.\UnlockSystem.cpp
# Begin Source File
SOURCE=.\UnlockSystem.h
# End Source File
# End Group
# Begin Group "cryptlib"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\crypto51\algparam.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\asn.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\basecode.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\channels.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\cryptlib.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\des.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\dessp.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\files.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\filters.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\fips140.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\hex.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\integer.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\iterhash.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\md5.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\misc.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\modes.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\mqueue.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\nbtheory.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\pkcspad.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\pssr.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\pubkey.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\queue.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\randpool.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\rsa.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\sha.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\crypto51\strciphr.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# End Group
# Begin Source File
-15
View File
@@ -9,21 +9,6 @@ Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name cryptlib
End Project Dependency
}}}
###############################################################################
Project: "cryptlib"=.\crypto51\cryptlib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
-11
View File
@@ -1,8 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepMania.vcproj", "{670745A6-106B-420D-A2A9-D4F89A23986E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "crypto51\cryptlib.vcproj", "{E34673D6-55FA-45C9-933A-FDD68CCD785F}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
@@ -11,7 +9,6 @@ Global
ConfigName.3 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{670745A6-106B-420D-A2A9-D4F89A23986E}.0 = {E34673D6-55FA-45C9-933A-FDD68CCD785F}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32
@@ -22,14 +19,6 @@ Global
{670745A6-106B-420D-A2A9-D4F89A23986E}.FIPS 140 Release.Build.0 = Release|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32
{670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.Debug.ActiveCfg = Debug|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.Debug.Build.0 = Debug|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Debug.ActiveCfg = FIPS 140 Debug|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Debug.Build.0 = FIPS 140 Debug|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Release.ActiveCfg = FIPS 140 Release|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Release.Build.0 = FIPS 140 Release|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.Release.ActiveCfg = Release|Win32
{E34673D6-55FA-45C9-933A-FDD68CCD785F}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
DPBuild = 5
+83 -1
View File
@@ -24,7 +24,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/EHa"
Optimization="0"
AdditionalIncludeDirectories=".,SDL-1.2.6/include,SDL_image-1.2,vorbis,libjpeg"
AdditionalIncludeDirectories=".,SDL-1.2.6/include,SDL_image-1.2,vorbis,libjpeg,crypto51"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,DEBUG"
ExceptionHandling="FALSE"
BasicRuntimeChecks="3"
@@ -2069,6 +2069,88 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
RelativePath="UnlockSystem.h">
</File>
</Filter>
<Filter
Name="cryptlib"
Filter="">
<File
RelativePath="crypto51\algparam.cpp">
</File>
<File
RelativePath="crypto51\asn.cpp">
</File>
<File
RelativePath="crypto51\basecode.cpp">
</File>
<File
RelativePath="crypto51\channels.cpp">
</File>
<File
RelativePath="crypto51\cryptlib.cpp">
</File>
<File
RelativePath="crypto51\des.cpp">
</File>
<File
RelativePath="crypto51\dessp.cpp">
</File>
<File
RelativePath="crypto51\files.cpp">
</File>
<File
RelativePath="crypto51\filters.cpp">
</File>
<File
RelativePath="crypto51\fips140.cpp">
</File>
<File
RelativePath="crypto51\hex.cpp">
</File>
<File
RelativePath="crypto51\integer.cpp">
</File>
<File
RelativePath="crypto51\iterhash.cpp">
</File>
<File
RelativePath="crypto51\md5.cpp">
</File>
<File
RelativePath="crypto51\misc.cpp">
</File>
<File
RelativePath="crypto51\modes.cpp">
</File>
<File
RelativePath="crypto51\mqueue.cpp">
</File>
<File
RelativePath="crypto51\nbtheory.cpp">
</File>
<File
RelativePath="crypto51\pkcspad.cpp">
</File>
<File
RelativePath="crypto51\pssr.cpp">
</File>
<File
RelativePath="crypto51\pubkey.cpp">
</File>
<File
RelativePath="crypto51\queue.cpp">
</File>
<File
RelativePath="crypto51\randpool.cpp">
</File>
<File
RelativePath="crypto51\rsa.cpp">
</File>
<File
RelativePath="crypto51\sha.cpp">
</File>
<File
RelativePath="crypto51\strciphr.cpp">
</File>
</Filter>
<File
RelativePath="StepMania.xpm">
</File>