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);