According to the benchmarks ( from the crypto++ website and archives ),
version 5.6.0 has better performance than 5.5.2, when using AES/CFB :

  *              Algorithm            *

*  MiB/Second  *

*  Cycles Per Byte  *

*Microseconds to
Setup Key and IV*

*Cycles to
Setup Key and IV*

*AES/CFB 128-bit key
Lib version: **5.6.0
   Windows Vista 32-bit   *

        108

          16.1

          0.926

         1695

*AES/CFB (128-bit key)
Lib version: **5.5.2
Windows XP 32-bit*

        69

          25.3

          0.746

         1366


I've been doing some tests and the results I'm getting do not match up with
this.   I created a small test app which creates a 2016 char std::string,
sets up an encryptor and decryptor with key (128 and 256 bit) and then
enters an encryption/decryption loop.   The app only considers the time the
program takes to execute the loop, not the initialization and set up.   I'm
providing the source code at the end of this email.

*Configuration: *
* Microsoft Windows XP SP 2
* Microsoft VC6 SP6

I ran the app 5 times for each configuration, under similar conditions.
All configs are in release mode, both for my app and the crypto++ library,
and optimized for Pentium Pro.   The name states the crypto++ library
version used, and also if using RTTI or not.

Results:

*128-bit key*
Release-v5.5.2-PPro-NoRTTI
16 / 16 / 16 / 16 / 16
Release-v5.5.2-PPro-RTTI
16 / 16 / 16 / 16 / 15
Release-v5.6.0-PPro-NoRTTI
"Access violation - no RTTI data!" error
Release-v5.6.0-PPro-RTTI
18 / 18 / 18 / 18 / 19

*256-bit key*
Release-v5.5.2-PPro-NoRTTI
17 / 18 / 17 / 17 / 18 secs
Release-v5.5.2-PPro-RTTI
18 / 18 / 18 / 18 / 17 secs
Release-v5.6.0-PPro-NoRTTI
"Access violation - no RTTI data!" error
Release-v5.6.0-PPro-RTTI
21 / 21 / 20 / 21 / 21 secs


Is there any way to use version 5.6.0 without enabling RTTI ?   I've read
this implies extra overhead.

Thanks a lot,
Walt.


*Source code:*

// Key and IV initialization goes here
// Key size is 16 bytes for 128-bit config, 32 bytes for 256-bit config

int main(int argc, char* argv[])
{
    time_t startTime, finishTime;

    // Message: 2016 chars (bytes)
    std::string plainText = "123456789123....( I've shortened this string
for this email )....6789123456789";

    // Debug
    std::cout << "Plain text: " << plainText << std::endl;
    std::cout << "Plain text size: " << plainText.size() << " bytes." <<
std::endl;

    // Cipher and Recovered text sinks
    std::string cipherText, recoveredText;

    // Block cipher: AES
    // Mode of operation: CFB (Cipher FeedBack)
    CFB_Mode< AES >::Encryption encryptor;
    CFB_Mode< AES >::Decryption decryptor;

    decryptor.SetKeyWithIV( key, sizeof(key), iv );
    encryptor.SetKeyWithIV( key, sizeof(key), iv );

    // save current time just before starting the encryption/decryption loop
    time( &startTime );

    for ( int i = 0; i < 200000; i++ )
    {
        // clean up for next round
        cipherText = "";
        recoveredText = "";

        try {
            StringSource( plainText, true,
                new StreamTransformationFilter( encryptor,
                    new StringSink( cipherText )
                ) // StreamTransformationFilter
            ); // StringSource
        } // end-try
        catch(CryptoPP::Exception &e)
        {
            std::cout << e.what() << std::endl << std::endl;
        }
        catch(std::exception &e)
        {
            std::cout << e.what() << std::endl << std::endl;
        }


        try {
            StringSource( cipherText, true,
                    new StreamTransformationFilter( decryptor,
                        new StringSink( recoveredText )
                    ) // StreamTransformationFilter
            ); // StringSource
        } // end-try
        catch(CryptoPP::Exception &e)
        {
            std::cout << e.what() << std::endl << std::endl;
        }
        catch(std::exception &e)
        {
            std::cout << e.what() << std::endl << std::endl;
        }

    } // end-for

    // save current time just after finishing the encryption/decryption loop
    time( &finishTime );

    double executionTimeInSec = difftime( finishTime, startTime );

    // Debug
    //std::cout << "Cipher text: " << cipherText << std::endl;
    //std::cout << "Cipher text size: " << cipherText.size() << " bytes." <<
std::endl;

    // Debug
    std::cout << "Recovered text: " << recoveredText << std::endl;
    std::cout << "Recovered text size: " << recoveredText.size() << "
bytes." << std::endl;

    std::cout << "Encryption/decryption loop execution time: " <<
executionTimeInSec << " seconds." << std::endl;

    return 0;
}

----------------------------------------------- eof.
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to