diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp index 1922461e..10643fec 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp @@ -84,19 +84,6 @@ namespace Crypt { * ***/ -//============================================================================ -static void Rc4Codec ( - CryptKey * key, - bool encrypt, - ARRAY(uint8_t) * dest, - unsigned sourceBytes, - const void * sourceData -) { - // RC4 uses the same algorithm to both encrypt and decrypt - dest->SetCount(sourceBytes); - RC4((RC4_KEY *)key->handle, sourceBytes, (const unsigned char *)sourceData, dest->Ptr()); -} - //============================================================================ static void Rc4Codec ( CryptKey * key, @@ -158,52 +145,12 @@ void CryptKeyClose ( delete key; } -//============================================================================ -unsigned CryptKeyGetBlockSize ( - CryptKey * key -) { - switch (key->algorithm) { - case kCryptRc4: { - return 1; - } - break; - - case kCryptRsa: // Not implemented; fall-thru to FATAL -// return RsaGetBlockSize(key); - - DEFAULT_FATAL(algorithm); - } -} - -//============================================================================ -void CryptEncrypt ( - CryptKey * key, - ARRAY(uint8_t) * dest, - unsigned sourceBytes, - const void * sourceData -) { - switch (key->algorithm) { - case kCryptRc4: { - Rc4Codec(key, true, dest, sourceBytes, sourceData); - } - break; - - case kCryptRsa: // Not implemented; fall-thru to FATAL -// RsaCodec(key, true, dest, sourceBytes, sourceData); -// break; - - DEFAULT_FATAL(key->algorithm); - } -} - //============================================================================ void CryptEncrypt ( CryptKey * key, unsigned bytes, void * data ) { - ASSERT(1 == CryptKeyGetBlockSize(key)); - switch (key->algorithm) { case kCryptRc4: { Rc4Codec(key, true, bytes, data); @@ -218,35 +165,12 @@ void CryptEncrypt ( } } -//============================================================================ -void CryptDecrypt ( - CryptKey * key, - ARRAY(uint8_t) * dest, - unsigned sourceBytes, - const void * sourceData -) { - switch (key->algorithm) { - case kCryptRc4: { - Rc4Codec(key, false, dest, sourceBytes, sourceData); - } - break; - - case kCryptRsa: // Not implemented; fall-thru to FATAL -// RsaCodec(key, false, dest, sourceBytes, sourceData); -// break; - - DEFAULT_FATAL(key->algorithm); - } -} - //============================================================================ void CryptDecrypt ( CryptKey * key, unsigned bytes, void * data ) { - ASSERT(1 == CryptKeyGetBlockSize(key)); - switch (key->algorithm) { case kCryptRc4: { Rc4Codec(key, false, bytes, data); diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h index 4b5ed241..bbf0ea6b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h @@ -83,45 +83,18 @@ void CryptKeyClose ( CryptKey * key ); -void CryptKeyGenerate ( - ECryptAlgorithm algorithm, - unsigned keyBits, // used for algorithms with variable key strength - unsigned randomBytes, - const void * randomData, - ARRAY(uint8_t) * privateData, - ARRAY(uint8_t) * publicData // only for public key cryptography -); - -unsigned CryptKeyGetBlockSize ( - CryptKey * key -); - /***************************************************************************** * * Encryption and Decryption * ***/ -void CryptEncrypt ( - CryptKey * key, - ARRAY(uint8_t) * dest, - unsigned sourceBytes, - const void * sourceData -); - void CryptEncrypt ( CryptKey * key, unsigned bytes, void * data ); -void CryptDecrypt ( - CryptKey * key, - ARRAY(uint8_t) * dest, // padded out to the algorithm's block size - unsigned sourceBytes, - const void * sourceData -); - void CryptDecrypt ( CryptKey * key, unsigned bytes, diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h index 0594f0c6..27a9e9bc 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h @@ -74,7 +74,6 @@ enum ELinkType { #define LINK(class) TLink< class > #define LIST(class) TList< class > #define LISTDECL(class,field) TListDecl< class, offsetof(class,field) > -#define LISTDYN(class) TListDyn< class > /**************************************************************************** @@ -618,25 +617,4 @@ template TListDecl::TListDecl () { this->SetLinkOffset(linkOffset); } - - -/**************************************************************************** -* -* TListDyn -* -***/ - -template -class TListDyn : public TList { - -public: - void Initialize (int linkOffset); - -}; - -//=========================================================================== -template -void TListDyn::Initialize (int linkOffset) { - this->SetLinkOffset(linkOffset); -} #endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h index 3ca71606..bf86661f 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h @@ -58,7 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PRIORITY_TIME(class) TPriorityTime< class > -#define PRIQ(class,priority) TPriorityQueue< class,priority > #define PRIQDECL(class,priority,field) TPriorityQueueDecl< class,priority,offsetof(class,field) >