Results 1 to 15 of 15

Thread: Compiling & using Crypto++ with mingw version of Qt

  1. #1
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Compiling & using Crypto++ with mingw version of Qt

    Hi pals!
    I personally had much trouble with these.
    apparently compiled version of crypto++ (cryptopp530win32win64.zip) is build using MSVC and does not work with mingw.
    fortunately I could get it to work finally.
    so I tell you too, step by step, how to do it.

    first download the cryptopp552.zip (crypto++ v5.5.2 sources)
    why cryptopp552.zip? apparently this is the latest version that is successfully compiled with mingw.

    extract the contents of the cryptopp552.zip to C:\cryptopp552

    edit the C:\cryptopp552\fipstest.cpp and replace every 'OutputDebugString' with 'OutputDebugStringA'. (3 replacements in total)
    don't forget to save it!

    delete the C:\cryptopp552\GNUmakefile

    open the Qt command prompt (I used that of the Qt SDK 2009.05)
    input the following commands at the Qt command line:
    c:
    cd \cryptopp552
    qmake -project

    open the cryptopp552.pro (that is now created in C:\cryptopp552)
    in it:
    change TEMPLATE = app to TEMPLATE = lib
    add a line containing LIBS += -lws2_32 at the end.

    type the following commands at the Qt command line:
    qmake
    mingw32-make all

    wait for the build process to finish (may take many minutes)

    now we should have files named libcryptopp552.a and cryptopp552.dll in directories C:\cryptopp552\release and C:\cryptopp552\debug

    copy the C:\cryptopp552\release\libcryptopp552.a to <Qt dir>\lib
    note that there is another directory named lib one level higher in the Qt SDK installation dir. So don't confuse them please.
    copy the C:\cryptopp552\release\cryptopp552.dll to <Qt dir>\bin
    note that there is another directory named bin one level higher in the Qt SDK installation dir. So don't confuse them please.

    create a directory named cryptopp in <Qt dir>\include.
    copy all header (.h) files from the C:\cryptopp552 to <Qt dir>\include\cryptopp.

    now we can test crypto++ and see how to use it in our Qt programs.

    first example is a program that computes an MD5 hash (of a hard coded string):

    main.cpp
    Qt Code:
    1. #include <iostream>
    2.  
    3. #define CRYPTOPP_DEFAULT_NO_DLL
    4. #include <cryptopp/dll.h>
    5. #ifdef CRYPTOPP_WIN32_AVAILABLE
    6. #include <windows.h>
    7. #endif
    8. #include <cryptopp/md5.h>
    9.  
    10. USING_NAMESPACE(CryptoPP)
    11. USING_NAMESPACE(std)
    12. const int MAX_PHRASE_LENGTH=250;
    13.  
    14. int main(int argc, char *argv[]) {
    15.  
    16. CryptoPP::MD5 hash;
    17. byte digest[ CryptoPP::MD5::DIGESTSIZE ];
    18. std::string message = "Hello World!";
    19.  
    20. hash.CalculateDigest( digest, (const byte*)message.c_str(), message.length());
    21.  
    22. CryptoPP::HexEncoder encoder;
    23. std::string output;
    24. encoder.Attach( new CryptoPP::StringSink( output ) );
    25. encoder.Put( digest, sizeof(digest) );
    26. encoder.MessageEnd();
    27.  
    28. std::cout << "Input string: " << message << std::endl;
    29. std::cout << "MD5: " << output << std::endl;
    30.  
    31. return 0;
    32. }
    To copy to clipboard, switch view to plain text mode 

    code from: http://www.cryptopp.com/wiki/Hash_Functions

    remember that you should add these lines to its .pro file before starting to build it:
    LIBS += -lcryptopp552
    CONFIG+=console

    the program should print these on the console window:
    Input string: Hello World!
    MD5: ED076287532E86365E841E92BFC50D8C

    second example is a program that takes 3 arguments at the command line.
    arguments are file names.
    the program then prompts for a Passphrase and then stores an encrypted version of the first file in the second file and then stores the result of decrypting the second file in the third file.
    sample command line I used: release\cryptopptest.exe 1.jpg 2.jpg 3.jpg

    Qt Code:
    1. #include <iostream>
    2.  
    3. #define CRYPTOPP_DEFAULT_NO_DLL
    4. #include <cryptopp/dll.h>
    5. #include <cryptopp/default.h>
    6. #ifdef CRYPTOPP_WIN32_AVAILABLE
    7. #include <windows.h>
    8. #endif
    9.  
    10. USING_NAMESPACE(CryptoPP)
    11. USING_NAMESPACE(std)
    12.  
    13. const int MAX_PHRASE_LENGTH=250;
    14.  
    15. void EncryptFile(const char *in,
    16. const char *out,
    17. const char *passPhrase);
    18. void DecryptFile(const char *in,
    19. const char *out,
    20. const char *passPhrase);
    21.  
    22.  
    23. int main(int argc, char *argv[])
    24. {
    25. try
    26. {
    27. char passPhrase[MAX_PHRASE_LENGTH];
    28. cout << "Passphrase: ";
    29. cin.getline(passPhrase, MAX_PHRASE_LENGTH);
    30. EncryptFile(argv[1], argv[2], passPhrase);
    31. DecryptFile(argv[2], argv[3], passPhrase);
    32. }
    33. catch(CryptoPP::Exception &e)
    34. {
    35. cout << "\nCryptoPP::Exception caught: "
    36. << e.what() << endl;
    37. return -1;
    38. }
    39. catch(std::exception &e)
    40. {
    41. cout << "\nstd::exception caught: " << e.what() << endl;
    42. return -2;
    43. }
    44. }
    45.  
    46.  
    47. void EncryptFile(const char *in,
    48. const char *out,
    49. const char *passPhrase)
    50. {
    51. FileSource f(in, true, new DefaultEncryptorWithMAC(passPhrase,
    52. new FileSink(out)));
    53. }
    54.  
    55. void DecryptFile(const char *in,
    56. const char *out,
    57. const char *passPhrase)
    58. {
    59. FileSource f(in, true,
    60. new DefaultDecryptorWithMAC(passPhrase, new FileSink(out)));
    61. }
    62.  
    63. RandomPool & GlobalRNG()
    64. {
    65. static RandomPool randomPool;
    66. return randomPool;
    67. }
    68. int (*AdhocTest)(int argc, char *argv[]) = NULL;
    To copy to clipboard, switch view to plain text mode 

    code from: http://www.codeguru.com/cpp/misc/mis...le.php/c11953/

    remember that you should add these lines to its .pro file before starting to build it:
    LIBS += -lcryptopp552
    CONFIG+=console

    --------------------------------

    I appreciate your feedback.
    good luck!

  2. The following 2 users say thank you to FS Lover for this useful post:

    programmer.huang (11th March 2010), sedi (16th January 2018)

  3. #2
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    this is a function I wrote & tested for encrypting an in memory file stored in a QByteArray.
    it takes a QByteArray and a passPhrase and then encrypts the contents of the QByteArray.
    Crypto++ encryption class which it uses is DefaultEncryptorWithMAC and according to the reference doc it uses Password-Based Encryptor using DES-EDE2 and HMAC/SHA-1.

    Qt Code:
    1. void encrypt(QByteArray &in_out, const char *passPhrase) {
    2.  
    3. string tmp;
    4. StringSource s((const byte *)in_out.constData(), in_out.size(), true, new DefaultEncryptorWithMAC(passPhrase, new StringSink(tmp)));
    5. in_out.clear();
    6. in_out.append(QByteArray(tmp.c_str(), tmp.size()));
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    for decrypting u simply need to a DefaultDecryptorWithMAC instead of the DefaultEncryptorWithMAC:

    Qt Code:
    1. void decrypt(QByteArray &in_out, const char *passPhrase) {
    2.  
    3. string tmp;
    4. StringSource s((const byte *)in_out.constData(), in_out.size(), true, new DefaultDecryptorWithMAC(passPhrase, new StringSink(tmp)));
    5. in_out.clear();
    6. in_out.append(QByteArray(tmp.c_str(), tmp.size()));
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    I am new to Crypto++ (and to cryptography in general) and haven't read the entire crypto++'s reference; Any idea about a better code is welcome.
    Last edited by FS Lover; 11th March 2010 at 21:24.

  4. #3
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    compiled (with mingw) Crypto++ lib and include files: http://www.4shared.com/file/24082421...mingw-bin.html (12 MB)

    and another download with no debug lib included: http://www.4shared.com/file/24082839...n-nodebug.html (2.5 MB)

  5. #4
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Quote Originally Posted by FS Lover View Post
    compiled (with mingw) Crypto++ lib and include files: http://www.4shared.com/file/24082421...mingw-bin.html (12 MB)

    and another download with no debug lib included: http://www.4shared.com/file/24082839...n-nodebug.html (2.5 MB)
    if i want use Vmac in Crypto Plus Plus On QT then how do i do ?

    _http://www.cryptopp.com/docs/ref/class_v_m_a_c.html

  6. #5
    Join Date
    Aug 2009
    Posts
    10
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Man your tutorial is just what a newbie needs
    else i would have been a goner


    Thank you really from my heart

    I love working in Qt , the only thing i Fell Qt lacks is real tutorials of using external plugins,library or dll's etc
    But you really made my day today
    thanks again

  7. #6
    Join Date
    Aug 2009
    Posts
    10
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    could you tell me waht would be the dependency when i run this program on different machine what parts of cryptolibrary need to be with the executable

  8. #7
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Quote Originally Posted by udit View Post
    the only thing i Fell Qt lacks is real tutorials of using external plugins,library or dll's etc
    That's because this has almost nothing to do with Qt.

  9. #8
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Crypto++ v5.5.1 Reference Manual: http://www.4shared.com/file/S5jvueo-...oPP551Ref.html

  10. #9
    Join Date
    Feb 2011
    Location
    The Netherlands
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Thanks for all the help in this thread!
    For all who might like, Crypto++ v 5.6.1 compiled on Windows 7 (32 bit) with the latest Qt 4.7 2010.05
    http://jinx.etv.cx/media/cryptopp561-mingw32-qt47.zip (12.2 MB)

    There might be a header or two too much in the includes etc, but they seem to be working.

  11. #10
    Join Date
    Dec 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Hi! It works nice but one thing: when I set CONFIG+=console, apart from my GUI windows, a console window appear (when running my application outside QtCreator). Any tricks to get rid of it?
    Regards!


    Added after 1 38 minutes:


    Quote Originally Posted by lzdziana View Post
    Hi! It works nice but one thing: when I set CONFIG+=console, apart from my GUI windows, a console window appear (when running my application outside QtCreator). Any tricks to get rid of it?
    Regards!
    Well... I just tried without CONFIG+=console and it seems to work I can't figure out what I did wrong previously (it seemd to me that cryptopp is crushing).
    Last edited by lzdziana; 12th December 2012 at 15:44.

  12. #11
    Join Date
    Mar 2014
    Posts
    9
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    A few years later.. this still works smooth on newest versions. Just want to add that i totally agree with this:
    Man your tutorial is just what a newbie needs
    else i would have been a goner


    Thank you really from my heart

    I love working in Qt , the only thing i Fell Qt lacks is real tutorials of using external plugins,library or dll's etc
    But you really made my day today
    thanks again

  13. #12
    Join Date
    Mar 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    you're amazing ,still working till now

  14. #13
    Join Date
    Apr 2015
    Posts
    2
    Thanked 1 Time in 1 Post

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Just for the sake of completeness:
    Today I tried Crypto++ 5.6.2 under mingw (about one year old installation).
    Just unzip, make and then run the validation (cryptest.exe v) as stated in the Readme-File ... "All tests passed!".

    First I got scared by this thread. But so far, no problem at all.

  15. #14
    Join Date
    Apr 2015
    Posts
    2
    Thanked 1 Time in 1 Post

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Ok, while compiling Crypto++ (v5.6.2) with a standalone MinGW installation was straight-forward, compiling and using it the Qt-way was a bit trickier.

    When looking at the GNUmakefile one can seperate the files for the test-executable (a few cpp/h-files) and those for the library (all other cpp/h/asm-files).
    Using QTCreator you can then create two seperate projets, add the existing files respectively and apply some tricks (prevent unicode linking problems etc.).

    Let me give you a summary of all this (using crypto++ v5.6.2 and QT v5.3.1):

    1) unzip crpypto562.zip into a new folder (e.g. "cryptopp562", somewhere where you store you QT-projects)
    2) copy both CryptoPPLib.pro and CryptoPPTest.pro into that new folder

    CryptoPPLib.pro:
    Qt Code:
    1. QT -= core gui
    2.  
    3. TARGET = CryptoPPLib
    4. TEMPLATE = lib
    5.  
    6. DEFINES += CRYPTOPPLIB_LIBRARY
    7.  
    8. SOURCES += 3way.cpp adler32.cpp algebra.cpp algparam.cpp arc4.cpp asn.cpp \
    9. authenc.cpp base32.cpp base64.cpp basecode.cpp bfinit.cpp blowfish.cpp \
    10. blumshub.cpp camellia.cpp cast.cpp casts.cpp cbcmac.cpp ccm.cpp \
    11. channels.cpp cmac.cpp cpu.cpp crc.cpp cryptlib.cpp cryptlib_bds.cpp \
    12. default.cpp des.cpp dessp.cpp dh.cpp dh2.cpp dll.cpp dsa.cpp eax.cpp \
    13. ec2n.cpp eccrypto.cpp ecp.cpp elgamal.cpp emsa2.cpp eprecomp.cpp esign.cpp \
    14. files.cpp filters.cpp fips140.cpp gcm.cpp gf256.cpp gf2_32.cpp gf2n.cpp \
    15. gfpcrypt.cpp gost.cpp gzip.cpp hex.cpp hmac.cpp hrtimer.cpp ida.cpp \
    16. idea.cpp integer.cpp iterhash.cpp luc.cpp mars.cpp marss.cpp md2.cpp \
    17. md4.cpp md5.cpp misc.cpp modes.cpp mqueue.cpp mqv.cpp nbtheory.cpp \
    18. network.cpp oaep.cpp osrng.cpp panama.cpp pch.cpp pkcspad.cpp polynomi.cpp \
    19. pssr.cpp pubkey.cpp queue.cpp rabin.cpp randpool.cpp rc2.cpp rc5.cpp \
    20. rc6.cpp rdtables.cpp rijndael.cpp ripemd.cpp rng.cpp rsa.cpp rw.cpp \
    21. safer.cpp salsa.cpp seal.cpp seed.cpp serpent.cpp sha.cpp sha3.cpp \
    22. shacal2.cpp shark.cpp sharkbox.cpp simple.cpp skipjack.cpp socketft.cpp \
    23. sosemanuk.cpp square.cpp squaretb.cpp strciphr.cpp tea.cpp tftables.cpp \
    24. tiger.cpp tigertab.cpp trdlocal.cpp ttmac.cpp twofish.cpp vmac.cpp \
    25. wait.cpp wake.cpp whrlpool.cpp winpipes.cpp xtr.cpp xtrcrypt.cpp \
    26. zdeflate.cpp zinflate.cpp zlib.cpp
    27.  
    28. HEADERS += 3way.h adler32.h aes.h algebra.h algparam.h arc4.h argnames.h \
    29. asn.h authenc.h base32.h base64.h basecode.h blowfish.h blumshub.h \
    30. camellia.h cast.h cbcmac.h ccm.h channels.h cmac.h config.h cpu.h crc.h \
    31. cryptlib.h default.h des.h dh.h dh2.h dll.h dmac.h dsa.h eax.h ec2n.h \
    32. eccrypto.h ecp.h elgamal.h emsa2.h eprecomp.h esign.h factory.h files.h \
    33. filters.h fips140.h fltrimpl.h gcm.h gf256.h gf2_32.h gf2n.h gfpcrypt.h \
    34. gost.h gzip.h hex.h hmac.h hrtimer.h ida.h idea.h integer.h iterhash.h \
    35. lubyrack.h luc.h mars.h md2.h md4.h md5.h mdc.h misc.h modarith.h modes.h \
    36. modexppc.h mqueue.h mqv.h nbtheory.h network.h nr.h oaep.h oids.h osrng.h \
    37. panama.h pch.h pkcspad.h polynomi.h pssr.h pubkey.h pwdbased.h queue.h \
    38. rabin.h randpool.h rc2.h rc5.h rc6.h resource.h rijndael.h ripemd.h rng.h \
    39. rsa.h rw.h safer.h salsa.h seal.h secblock.h seckey.h seed.h serpent.h \
    40. serpentp.h sha.h sha3.h shacal2.h shark.h simple.h skipjack.h smartptr.h \
    41. socketft.h sosemanuk.h square.h stdcpp.h strciphr.h tea.h tiger.h \
    42. trdlocal.h trunhash.h ttmac.h twofish.h vmac.h wait.h wake.h whrlpool.h \
    43. winpipes.h words.h xtr.h xtrcrypt.h zdeflate.h zinflate.h zlib.h
    44.  
    45. unix {
    46. target.path = /usr/lib
    47. INSTALLS += target
    48. }
    49.  
    50. # added manually
    51. LIBS += -lws2_32
    52. CONFIG += warn_off
    To copy to clipboard, switch view to plain text mode 
    CryptoPPTest.pro:
    Qt Code:
    1. TEMPLATE = app
    2. CONFIG += console
    3. CONFIG -= app_bundle
    4. CONFIG -= qt
    5.  
    6. SOURCES += bench.cpp bench2.cpp datatest.cpp dlltest.cpp fipsalgt.cpp \
    7. fipstest.cpp regtest.cpp test.cpp validat1.cpp validat2.cpp validat3.cpp \
    8.  
    9.  
    10. HEADERS += bench.h validate.h
    11.  
    12. #added manually
    13. DEFINES -= UNICODE
    14. CONFIG += warn_off
    15. LIBS += -lws2_32
    16.  
    17. OTHER_FILES += TestData\* TestVectors\*
    18. CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release
    19. CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug
    20. TestData.path = $${DESTDIR}/TestData
    21. TestData.files = TestData/*
    22. TestVectors.path = $${DESTDIR}/TestVectors
    23. TestVectors.files = TestVectors/*
    24. INSTALLS += TestVectors TestData
    25.  
    26. # added by QTCreator
    27. win32:CONFIG(release, debug|release): LIBS += -L$$PWD/release/ -lCryptoPPLib
    28. else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/debug/ -lCryptoPPLib
    29. else:unix: LIBS += -L$$PWD/ -lCryptoPPLib
    30. INCLUDEPATH += $$PWD/
    31. DEPENDPATH += $$PWD/
    To copy to clipboard, switch view to plain text mode 
    3) remove GNUmakefile (e.g. just rename to GNUmakefile.backup)

    Building the Library:

    4) open CryptoPPLib.pro in QTCreator
    5) in projects-view -> on build tab -> uncheck the box for "Shadow-Build" (no shadow-build)
    6) run qmake
    7) build (... takes a while)

    Building and running the Test-Executable:

    8) open CryptoPPTest.pro in QTCreator
    9) in projects-view -> on build tab -> uncheck the box for "Shadow-Build" (no shadow-build)
    10) in projects-view -> on build tab -> add build step (using Make) -> with argument "install" for make
    11) in projects-view -> on run/execution tab -> add argument: "v"
    12) run qmake
    13) buid & run

    At the end you should see that "All test passed!".

    (Note: Changes for shadow-build, "install" and "v" may have to be applied for Debug and Release.)

    Now you can use the lib in your QT-Widgets-Application:

    14) Create new QT-Widgets-Application
    15) Add the Cryptopp-Lib to this project: Add library -> external library -> set
    - library: the library that was build above ("... some path .... /cryptopp562/debug/libCryptoPPLib.a")
    - include-path: folder "crypto562" directly
    16) run qmake

    Now you can use it, for instance by applying the MD5-Example from the CryptoPP-Wiki:

    17) Via Designer add "Text Edit" to MainWindow.
    18) in mainwindow.cpp add to the beginning of the file:
    Qt Code:
    1. #include <md5.h>
    2. #include <hex.h>
    To copy to clipboard, switch view to plain text mode 
    19) ... and in the constructor add after ui-setup:
    Qt Code:
    1. CryptoPP::MD5 hash;
    2. byte digest[ CryptoPP::MD5::DIGESTSIZE ];
    3. std::string message = "abcdefghijklmnopqrstuvwxyz";
    4.  
    5. hash.CalculateDigest( digest, (byte*) message.c_str(), message.length() );
    6.  
    7. CryptoPP::HexEncoder encoder;
    8. std::string output;
    9. encoder.Attach( new CryptoPP::StringSink( output ) );
    10. encoder.Put( digest, sizeof(digest) );
    11. encoder.MessageEnd();
    12.  
    13. ui->textEdit->append(QString::fromStdString(output));
    14. // std::cout << output << std::endl;
    To copy to clipboard, switch view to plain text mode 
    20) build & run ... you should see the application-window displaying the MD5-result.

    (Note: you may want to turn of warnings again as done in the project-files provided above.)

    Cheers
    Stefan

  16. The following user says thank you to Stefan Fritzsche for this useful post:

    sedi (16th January 2018)

  17. #15
    Join Date
    Jan 2012
    Location
    Dortmund, Germany
    Posts
    159
    Thanks
    69
    Thanked 10 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Compiling & using Crypto++ with mingw version of Qt

    Hi,

    what a very helpful thread! For future users: I have adapted the above for the current CryptoPP V5.6.4, compiled with a stock Qt 5.10 on a Win10 machine, keeping close to the Stephan Fritzsches advice above. Compiles well, all tests pass.

    CryptoPPLib.pro:
    Qt Code:
    1. QT -= core gui
    2.  
    3. TARGET = CryptoPPLib
    4. TEMPLATE = lib
    5.  
    6. DEFINES += CRYPTOPPLIB_LIBRARY
    7.  
    8. SOURCES += \
    9. 3way.cpp \
    10. adler32.cpp \
    11. algebra.cpp \
    12. algparam.cpp \
    13. arc4.cpp \
    14. asn.cpp \
    15. authenc.cpp \
    16. base32.cpp \
    17. base64.cpp \
    18. basecode.cpp \
    19. bfinit.cpp \
    20. blowfish.cpp \
    21. blumshub.cpp \
    22. camellia.cpp \
    23. cast.cpp \
    24. casts.cpp \
    25. cbcmac.cpp \
    26. ccm.cpp \
    27. channels.cpp \
    28. cmac.cpp \
    29. cpu.cpp \
    30. crc.cpp \
    31. cryptlib.cpp \
    32. default.cpp \
    33. des.cpp \
    34. dessp.cpp \
    35. dh.cpp \
    36. dh2.cpp \
    37. dll.cpp \
    38. dsa.cpp \
    39. eax.cpp \
    40. ec2n.cpp \
    41. eccrypto.cpp \
    42. ecp.cpp \
    43. elgamal.cpp \
    44. emsa2.cpp \
    45. eprecomp.cpp \
    46. esign.cpp \
    47. files.cpp \
    48. filters.cpp \
    49. fips140.cpp \
    50. gcm.cpp \
    51. gf2_32.cpp \
    52. gf2n.cpp \
    53. gf256.cpp \
    54. gfpcrypt.cpp \
    55. gost.cpp \
    56. gzip.cpp \
    57. hex.cpp \
    58. hmac.cpp \
    59. hrtimer.cpp \
    60. ida.cpp \
    61. idea.cpp \
    62. integer.cpp \
    63. iterhash.cpp \
    64. luc.cpp \
    65. mars.cpp \
    66. marss.cpp \
    67. md2.cpp \
    68. md4.cpp \
    69. md5.cpp \
    70. misc.cpp \
    71. modes.cpp \
    72. mqueue.cpp \
    73. mqv.cpp \
    74. nbtheory.cpp \
    75. network.cpp \
    76. oaep.cpp \
    77. osrng.cpp \
    78. panama.cpp \
    79. pch.cpp \
    80. pkcspad.cpp \
    81. polynomi.cpp \
    82. pssr.cpp \
    83. pubkey.cpp \
    84. queue.cpp \
    85. rabin.cpp \
    86. randpool.cpp \
    87. rc2.cpp \
    88. rc5.cpp \
    89. rc6.cpp \
    90. rdtables.cpp \
    91. rijndael.cpp \
    92. ripemd.cpp \
    93. rng.cpp \
    94. rsa.cpp \
    95. rw.cpp \
    96. safer.cpp \
    97. salsa.cpp \
    98. seal.cpp \
    99. seed.cpp \
    100. serpent.cpp \
    101. sha.cpp \
    102. sha3.cpp \
    103. shacal2.cpp \
    104. shark.cpp \
    105. sharkbox.cpp \
    106. simple.cpp \
    107. skipjack.cpp \
    108. socketft.cpp \
    109. sosemanuk.cpp \
    110. square.cpp \
    111. squaretb.cpp \
    112. strciphr.cpp \
    113. tea.cpp \
    114. tftables.cpp \
    115. tiger.cpp \
    116. tigertab.cpp \
    117. trdlocal.cpp \
    118. ttmac.cpp \
    119. twofish.cpp \
    120. vmac.cpp \
    121. wait.cpp \
    122. wake.cpp \
    123. whrlpool.cpp \
    124. winpipes.cpp \
    125. xtr.cpp \
    126. xtrcrypt.cpp \
    127. zdeflate.cpp \
    128. zinflate.cpp \
    129. zlib.cpp
    130.  
    131. HEADERS += \
    132. 3way.h \
    133. adler32.h \
    134. aes.h \
    135. algebra.h \
    136. algparam.h \
    137. arc4.h \
    138. argnames.h \
    139. asn.h \
    140. authenc.h \
    141. base32.h \
    142. base64.h \
    143. basecode.h \
    144. # bench \
    145. blake2.h \
    146. blowfish.h \
    147. blumshub.h \
    148. camellia.h \
    149. cast.h \
    150. cbcmac.h \
    151. ccm.h \
    152. chacha.h \
    153. channels.h \
    154. cmac.h \
    155. config.h \
    156. cpu.h \
    157. crc.h \
    158. cryptlib.h \
    159. default.h \
    160. des.h \
    161. dh.h \
    162. dh2.h \
    163. dll.h \
    164. dmac.h \
    165. dsa.h \
    166. eax.h \
    167. ec2n.h \
    168. eccrypto.h \
    169. ecp.h \
    170. elgamal.h \
    171. emsa2.h \
    172. eprecomp.h \
    173. esign.h \
    174. factory.h \
    175. fhmqv.h \
    176. files.h \
    177. filters.h \
    178. fips140.h \
    179. fltrimpl.h \
    180. gcm.h \
    181. gf2_32.h \
    182. gf2n.h \
    183. gf256.h \
    184. gfpcrypt.h \
    185. gost.h \
    186. gzip.h \
    187. hex.h \
    188. hkdf.h \
    189. hmac.h \
    190. hmqv.h \
    191. hrtimer.h \
    192. ida.h \
    193. idea.h \
    194. integer.h \
    195. iterhash.h \
    196. keccak.h \
    197. lubyrack.h \
    198. luc.h \
    199. mars.h \
    200. md2.h \
    201. md4.h \
    202. md5.h \
    203. mdc.h \
    204. mersenne.h \
    205. misc.h \
    206. modarith.h \
    207. modes.h \
    208. modexppc.h \
    209. mqueue.h \
    210. mqv.h \
    211. nbtheory.h \
    212. network.h \
    213. nr.h \
    214. oaep.h \
    215. oids.h \
    216. osrng.h \
    217. ossig.h \
    218. panama.h \
    219. pch.h \
    220. pkcspad.h \
    221. polynomi.h \
    222. pssr.h \
    223. pubkey.h \
    224. pwdbased.h \
    225. queue.h \
    226. rabin.h \
    227. randpool.h \
    228. rc2.h \
    229. rc5.h \
    230. rc6.h \
    231. rdrand.h \
    232. resource.h \
    233. rijndael.h \
    234. ripemd.h \
    235. rng.h \
    236. rsa.h \
    237. rw.h \
    238. safer.h \
    239. salsa.h \
    240. seal.h \
    241. secblock.h \
    242. seckey.h \
    243. seed.h \
    244. serpent.h \
    245. serpentp.h \
    246. sha.h \
    247. sha3.h \
    248. shacal2.h \
    249. shark.h \
    250. simple.h \
    251. skipjack.h \
    252. smartptr.h \
    253. socketft.h \
    254. sosemanuk.h \
    255. square.h \
    256. stdcpp.h \
    257. strciphr.h \
    258. tea.h \
    259. tiger.h \
    260. trap.h \
    261. trdlocal.h \
    262. trunhash.h \
    263. ttmac.h \
    264. twofish.h \
    265. # validate.h \
    266. vmac.h \
    267. wait.h \
    268. wake.h \
    269. whrlpool.h \
    270. winpipes.h \
    271. words.h \
    272. xtr.h \
    273. xtrcrypt.h \
    274. zdeflate.h \
    275. zinflate.h \
    276. zlib.h \
    277.  
    278. unix {
    279. target.path = /usr/lib
    280. INSTALLS += target
    281. }
    282.  
    283. # added manually
    284. LIBS += -lws2_32
    285. CONFIG += warn_off
    To copy to clipboard, switch view to plain text mode 
    CryptoPPTest.pro:
    Qt Code:
    1. TEMPLATE = app
    2. CONFIG += console
    3. CONFIG -= app_bundle
    4. CONFIG -= qt
    5.  
    6. SOURCES += bench1.cpp bench2.cpp datatest.cpp dlltest.cpp fipsalgt.cpp \
    7. fipstest.cpp regtest.cpp test.cpp validat1.cpp validat2.cpp validat3.cpp \
    8. keccak.cpp blake2.cpp chacha.cpp rdrand.cpp \
    9.  
    10.  
    11. HEADERS += bench.h validate.h keccak.h blake2.h chacha.h rdrand.h
    12.  
    13. #added manually
    14. DEFINES -= UNICODE
    15. CONFIG += warn_off
    16. LIBS += -lws2_32
    17.  
    18. OTHER_FILES += TestData\* TestVectors\*
    19. CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release
    20. CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug
    21. TestData.path = $${DESTDIR}/TestData
    22. TestData.files = TestData/*
    23.   TestVectors.path = $${DESTDIR}/TestVectors
    24.   TestVectors.files = TestVectors/*
    25.   INSTALLS += TestVectors TestData
    26.  
    27.   # added by QTCreator
    28.   win32:CONFIG(release, debug|release): LIBS += -L$$PWD/release/ -lCryptoPPLib
    29.   else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/debug/ -lCryptoPPLib
    30.   else:unix: LIBS += -L$$PWD/ -lCryptoPPLib
    31.   INCLUDEPATH += $$PWD/
    32.   DEPENDPATH += $$PWD/
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Don't configure under vs command prompt when building gcc (mingw) version of qt
    By piotr.dobrogost in forum Installation and Deployment
    Replies: 4
    Last Post: 1st February 2011, 21:28
  2. Windows minGW g++ version 3.4.5
    By PUK_999 in forum Newbie
    Replies: 4
    Last Post: 21st August 2009, 23:38
  3. Replies: 2
    Last Post: 12th July 2009, 09:24
  4. using the qt 4.4.0 evaluation version with MinGw
    By dano in forum Installation and Deployment
    Replies: 4
    Last Post: 4th July 2008, 17:02
  5. Wich MinGW Version should i use for QT 4.4.0?
    By raphaelf in forum Installation and Deployment
    Replies: 3
    Last Post: 27th May 2008, 15:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.