Is it possible to add a new algorithm to cryptopp benchmarks?

51 views
Skip to first unread message

Mehmet TUFEKCI

unread,
Apr 11, 2017, 4:17:06 PM4/11/17
to Crypto++ Users
Hi everyone! I want to bench an algorithm (aes version) which is not in cryptopp benchmarks. If it is possible, how can I do this? Thanks in advance.

Jeffrey Walton

unread,
Apr 13, 2017, 12:39:26 AM4/13/17
to Crypto++ Users


On Tuesday, April 11, 2017 at 4:17:06 PM UTC-4, Mehmet TUFEKCI wrote:
Hi everyone! I want to bench an algorithm (aes version) which is not in cryptopp benchmarks. If it is possible, how can I do this? Thanks in advance.

Yes. An example of add a new cipher is available at https://github.com/weidai11/cryptopp/commit/8ca0f479391c54ee454e9cddfcbe1657da240f85.

Ensure the name you use in regtest.cpp (to register the name) is the same name used when bench marking (bench marks create objects based on the registered name).

Jeff
Message has been deleted

Mehmet TUFEKCI

unread,
Apr 17, 2017, 4:59:25 PM4/17/17
to Jeffrey Walton, Crypto++ Users
Hi everyone!

I add my new algorithm to crypto++. But when I make bench it gives segmentation fault. Any idea why?

Thanks in advance.

On Mon, Apr 17, 2017 at 9:32 AM, Mehmet TUFEKCI <mtufek...@gmail.com> wrote:
Dear Jeffrey Walton;

Which version of crypto++ is used for this?

Best regards..

Mehmet

--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscribe@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to a topic in the Google Groups "Crypto++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cryptopp-users/rwRSMrxJVcw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cryptopp-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jeffrey Walton

unread,
Apr 18, 2017, 2:10:22 AM4/18/17
to Crypto++ Users, nolo...@gmail.com


On Monday, April 17, 2017 at 4:59:25 PM UTC-4, Mehmet TUFEKCI wrote:
Hi everyone!

I add my new algorithm to crypto++. But when I make bench it gives segmentation fault. Any idea why?

No idea. Run it under Valgrind or another memory checker.

Jeff

Mehmet TUFEKCI

unread,
May 4, 2017, 4:15:25 PM5/4/17
to Crypto++ Users, nolo...@gmail.com


18 Nisan 2017 Salı 09:10:22 UTC+3 tarihinde Jeffrey Walton yazdı:


Hi Jeff;

I have registered my new algorithm. I add aes.cpp to crypto++ library.  But there is problem;

void AES_X::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
    xorbuf(outBlock, inBlock, m_x1, BLOCKSIZE);
    //m_aes->ProcessAndXorBlock(outBlock, xorBlock, outBlock);
    xorbuf(outBlock, m_x3, BLOCKSIZE);
}

In this function if I use "m_aes->ProcessAndXorBlock(outBlock, xorBlock, outBlock);" it gives segmentation fault. Any idea why?

Best regards...

Jeffrey Walton

unread,
May 4, 2017, 5:14:49 PM5/4/17
to Mehmet TUFEKCI, Crypto++ Users
> I have registered my new algorithm. I add aes.cpp to crypto++ library. But
> there is problem;
>
> void AES_X::Base::ProcessAndXorBlock(const byte *inBlock, const byte
> *xorBlock, byte *outBlock) const
> {
> xorbuf(outBlock, inBlock, m_x1, BLOCKSIZE);
> //m_aes->ProcessAndXorBlock(outBlock, xorBlock, outBlock);
> xorbuf(outBlock, m_x3, BLOCKSIZE);
> }
>
> In this function if I use "m_aes->ProcessAndXorBlock(outBlock, xorBlock,
> outBlock);" it gives segmentation fault. Any idea why?

No, I have no idea.

Perhaps you can provide the Valgrind trace? Or maybe the stack
associated with the crash?

I don't know anyone who can answer questions like you ask with no
information. https://www.cryptopp.com/wiki/Bug_Report.

Jeff

Mehmet TUFEKCI

unread,
May 4, 2017, 5:35:47 PM5/4/17
to Crypto++ Users, mtufek...@gmail.com, nolo...@gmail.com


5 Mayıs 2017 Cuma 00:14:49 UTC+3 tarihinde Jeffrey Walton yazdı:


Jeff;

Here is my valgrind trace added log_test.txt. Could you pls have a look?

Thanks in advance.
log_test.txt

Jeffrey Walton

unread,
May 4, 2017, 6:27:56 PM5/4/17
to Mehmet TUFEKCI, Crypto++ Users
On Thu, May 4, 2017 at 5:35 PM, Mehmet TUFEKCI <mtufek...@gmail.com> wrote:
>
> 5 Mayıs 2017 Cuma 00:14:49 UTC+3 tarihinde Jeffrey Walton yazdı:
>>
>> > I have registered my new algorithm. I add aes.cpp to crypto++ library.
>> > But
>> > there is problem;
>> >
>> > void AES_X::Base::ProcessAndXorBlock(const byte *inBlock, const byte
>> > *xorBlock, byte *outBlock) const
>> > {
>> > xorbuf(outBlock, inBlock, m_x1, BLOCKSIZE);
>> > //m_aes->ProcessAndXorBlock(outBlock, xorBlock, outBlock);
>> > xorbuf(outBlock, m_x3, BLOCKSIZE);
>> > }
>> >
>> > In this function if I use "m_aes->ProcessAndXorBlock(outBlock, xorBlock,
>> > outBlock);" it gives segmentation fault. Any idea why?
>>
>> No, I have no idea.
>>
>> Perhaps you can provide the Valgrind trace? Or maybe the stack
>> associated with the crash?
>>
>> I don't know anyone who can answer questions like you ask with no
>> information. https://www.cryptopp.com/wiki/Bug_Report.
>>
>
> Here is my valgrind trace added log_test.txt. Could you pls have a look?

It looks like you have not built with symbols or you are building with
optimizations that are too high. Please visit
http://valgrind.org/docs/manual/quick-start.html#quick-start.prepare.

This usually means you need to update Valgrind:

==6901== by 0x8069413: BenchmarkAll(double, double) (bench1.cpp:302)
==6901== by 0x804DAAC: main (test.cpp:367)
==6901== Your program just tried to execute an instruction that Valgrind
==6901== did not recognise. There are two possible reasons for this.
==6901== 1. Your program has a bug and erroneously jumped to a non-code
==6901== location. If you are running Memcheck and you just saw a
==6901== warning about a bad jump, it's probably your program's fault.
==6901== 2. The instruction is legitimate but Valgrind doesn't handle it,
==6901== i.e. it's Valgrind's fault. If you think this is the case or
==6901== you are not sure, please let us know and we'll try to fix it.
==6901== Either way, Valgrind will now raise a SIGILL signal which will
==6901== probably kill your program.



Jeff

Jeffrey Walton

unread,
May 6, 2017, 10:59:51 PM5/6/17
to Crypto++ Users, mtufek...@gmail.com, nolo...@gmail.com


On Thursday, May 4, 2017 at 6:27:56 PM UTC-4, Jeffrey Walton wrote:
On Thu, May 4, 2017 at 5:35 PM, Mehmet TUFEKCI <mtufek...@gmail.com> wrote:
>
> 5 Mayıs 2017 Cuma 00:14:49 UTC+3 tarihinde Jeffrey Walton yazdı:
>> ...

>
> Here is my valgrind trace added log_test.txt. Could you pls have a look?

It looks like you have not built with symbols or you are building with
optimizations that are too high. Please visit
http://valgrind.org/docs/manual/quick-start.html#quick-start.prepare.

This usually means you need to update Valgrind:

==6901==    by 0x8069413: BenchmarkAll(double, double) (bench1.cpp:302)
==6901==    by 0x804DAAC: main (test.cpp:367)
==6901== Your program just tried to execute an instruction that Valgrind
==6901== did not recognise.  There are two possible reasons for this.
==6901== 1. Your program has a bug and erroneously jumped to a non-code
==6901==    location.  If you are running Memcheck and you just saw a
==6901==    warning about a bad jump, it's probably your program's fault.
==6901== 2. The instruction is legitimate but Valgrind doesn't handle it,
==6901==    i.e. it's Valgrind's fault.  If you think this is the case or
==6901==    you are not sure, please let us know and we'll try to fix it.
==6901== Either way, Valgrind will now raise a SIGILL signal which will
==6901== probably kill your program.

We added a recipe to build the library for Valgrind; see https://github.com/weidai11/cryptopp/commit/c62e1ade6ed1e0f6d739dbe6a59f08975c88a60b.

You will still need to update Valgrind or build Valgrind from the project's SVN sources to get the latest VEX decoder. Also see http://valgrind.org/downloads/repository.html.

Nearly every machine I have runs Valgrind from SVN sources. I can't count how many times I've experienced the SIGILL because VEX was out of date from a distro.

Jeff
Message has been deleted

Mehmet TUFEKCI

unread,
May 7, 2017, 8:29:20 AM5/7/17
to Crypto++ Users, mtufek...@gmail.com, nolo...@gmail.com


7 Mayıs 2017 Pazar 05:59:51 UTC+3 tarihinde Jeffrey Walton yazdı:

Dear Jeff;

Thanks for Valgrind update. I have got latest VEX decoder. But nothing changed. I have attaxhed my logs again. On the other hand I have changed my new aes version. I have written aes_x. In aes_x I used rijndael codes but in the aes_x.cpp it's given " ‘‘Se’ was not declared in this scope " error. I have attached my aes_x.cpp and aes_x.h files. Could you please check it and tell where is my problem?

Best regards..
 
aes_x.cpp
aes_x.h
log7test.txt

Jeffrey Walton

unread,
May 7, 2017, 2:13:56 PM5/7/17
to Crypto++ Users, mtufek...@gmail.com, nolo...@gmail.com

Thanks for Valgrind update. I have got latest VEX decoder. But nothing changed. I have attaxhed my logs again. On the other hand I have changed my new aes version. I have written aes_x. In aes_x I used rijndael codes but in the aes_x.cpp it's given " ‘‘Se’ was not declared in this scope " error. I have attached my aes_x.cpp and aes_x.h files. Could you please check it and tell where is my problem

Jeffrey Walton

unread,
May 7, 2017, 2:56:18 PM5/7/17
to Crypto++ Users, mtufek...@gmail.com, nolo...@gmail.com


Dear Jeff;

Thanks for Valgrind update. I have got latest VEX decoder. But nothing changed.

This looks like your Valgrind issue: https://bugs.kde.org/show_bug.cgi?id=295974.

Use another tool.

Jeff
Reply all
Reply to author
Forward
0 new messages