From 0a80cfd57d271dd44221467efb426675fa470356 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 18:31:12 +0000 Subject: TQt4 port kvirc This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/modules/rijndael/libkvirijndael.cpp | 12 ++++++------ src/modules/rijndael/libkvirijndael.h | 12 +++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/modules/rijndael') diff --git a/src/modules/rijndael/libkvirijndael.cpp b/src/modules/rijndael/libkvirijndael.cpp index 0a678437..07f37afe 100644 --- a/src/modules/rijndael/libkvirijndael.cpp +++ b/src/modules/rijndael/libkvirijndael.cpp @@ -46,7 +46,7 @@ on the Advanced Encryptiong Standard algorithm called Rijndael. Rijndael was originally written by Joan Daemen and Vincent Rijmen. The original Rijndael description is available at http://www.esat.kuleuven.ac.be/~rijmen/rijndael/.[br] - It is a private key block cipher that has been designed to replace + It is a private key block cipher that has been designed to tqreplace the widely used DES, and it should provide at leas a decent security agains common attacks. Theoretically the best attack that one can perform on this cipher is the "brute force" attack that requires a really massive parallel computation: @@ -471,7 +471,7 @@ */ } - static unsigned char fake_base64[]="./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + static unsigned char fake_base64[]="./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPTQRSTUVWXYZ"; unsigned int fake_base64dec(unsigned char c) { @@ -538,9 +538,9 @@ unsigned char * p = (unsigned char *)encoded.ptr(); while(outb < oute) { - Q_UINT32 * dd1 = (Q_UINT32 *)outb; + TQ_UINT32 * dd1 = (TQ_UINT32 *)outb; outb += 4; - Q_UINT32 * dd2 = (Q_UINT32 *)outb; + TQ_UINT32 * dd2 = (TQ_UINT32 *)outb; outb += 4; *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; @@ -585,9 +585,9 @@ unsigned char * bufp = buf; while(p < e) { - Q_UINT32 * dw1 = (Q_UINT32 *)bufp; + TQ_UINT32 * dw1 = (TQ_UINT32 *)bufp; bufp += 4; - Q_UINT32 * dw2 = (Q_UINT32 *)bufp; + TQ_UINT32 * dw2 = (TQ_UINT32 *)bufp; bufp += 4; *dw2 = 0; for(i=0;i < 6;i++)*dw2 |= (fake_base64dec(*p++)) << (i * 6); diff --git a/src/modules/rijndael/libkvirijndael.h b/src/modules/rijndael/libkvirijndael.h index 900ff252..38a92056 100644 --- a/src/modules/rijndael/libkvirijndael.h +++ b/src/modules/rijndael/libkvirijndael.h @@ -32,6 +32,7 @@ class KviRijndaelEngine : public KviCryptEngine { Q_OBJECT + TQ_OBJECT public: KviRijndaelEngine(); virtual ~KviRijndaelEngine(); @@ -54,6 +55,7 @@ class KviRijndaelHexEngine : public KviRijndaelEngine { Q_OBJECT + TQ_OBJECT public: KviRijndaelHexEngine() : KviRijndaelEngine() {}; virtual ~KviRijndaelHexEngine(){}; @@ -65,6 +67,7 @@ class KviRijndael128HexEngine : public KviRijndaelHexEngine { Q_OBJECT + TQ_OBJECT public: KviRijndael128HexEngine() : KviRijndaelHexEngine() {}; virtual ~KviRijndael128HexEngine(){}; @@ -76,6 +79,7 @@ class KviRijndael192HexEngine : public KviRijndaelHexEngine { Q_OBJECT + TQ_OBJECT public: KviRijndael192HexEngine() : KviRijndaelHexEngine() {}; virtual ~KviRijndael192HexEngine(){}; @@ -87,6 +91,7 @@ class KviRijndael256HexEngine : public KviRijndaelHexEngine { Q_OBJECT + TQ_OBJECT public: KviRijndael256HexEngine() : KviRijndaelHexEngine() {}; virtual ~KviRijndael256HexEngine(){}; @@ -97,6 +102,7 @@ class KviRijndaelBase64Engine : public KviRijndaelEngine { Q_OBJECT + TQ_OBJECT public: KviRijndaelBase64Engine() : KviRijndaelEngine() {}; virtual ~KviRijndaelBase64Engine(){}; @@ -108,6 +114,7 @@ class KviRijndael128Base64Engine : public KviRijndaelBase64Engine { Q_OBJECT + TQ_OBJECT public: KviRijndael128Base64Engine() : KviRijndaelBase64Engine() {}; virtual ~KviRijndael128Base64Engine(){}; @@ -119,6 +126,7 @@ class KviRijndael192Base64Engine : public KviRijndaelBase64Engine { Q_OBJECT + TQ_OBJECT public: KviRijndael192Base64Engine() : KviRijndaelBase64Engine() {}; virtual ~KviRijndael192Base64Engine(){}; @@ -130,6 +138,7 @@ class KviRijndael256Base64Engine : public KviRijndaelBase64Engine { Q_OBJECT + TQ_OBJECT public: KviRijndael256Base64Engine() : KviRijndaelBase64Engine() {}; virtual ~KviRijndael256Base64Engine(){}; @@ -144,6 +153,7 @@ class KviMircryptionEngine : public KviCryptEngine { Q_OBJECT + TQ_OBJECT public: KviMircryptionEngine(); ~KviMircryptionEngine(); @@ -153,7 +163,7 @@ KviStr m_szDecryptKey; bool m_bDecryptCBC; public: - virtual bool isCryptographicEngine(){ return false; }; // we need to return false since it doesn't use the Qt::CTRL+P escape + virtual bool isCryptographicEngine(){ return false; }; // we need to return false since it doesn't use the TQt::CTRL+P escape virtual bool init(const char *encKey,int encKeyLen,const char *decKey,int decKeyLen); virtual KviCryptEngine::EncryptResult encrypt(const char * plainText,KviStr &outBuffer); virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer,KviStr &plainText); -- cgit v1.2.1