Page 1 of 1

SHA3 speed PB540 include vs SHA3 module ?

Posted: Thu Nov 19, 2015 11:01 pm
by walbus
For debugging i have maked my new QUICk-AES-256 3.0 source compatible to PB531.
So far, i have change the PB SHA3 function with the here available SHA3 module.
The tool use exzessive hashes and i see, with the SHAs Module a speed up from about 40% all over.
Now, i think, PB540 use also this module, or a other ??

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 9:10 am
by Fred
What's the bug exactly ? Which module do you talk about ?

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 9:34 am
by wilbert
The output of the PB hashes is fine so no bug.

I think walbus is referring to the module in this thread http://www.purebasic.fr/english/viewtop ... 12&t=56420 which contains implementations Sec and I created taking advantage of features like MMX, SSE2 or 64 bit.
I suppose PB uses the reference C implementation without such optimizations which would explain why it might be slower.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 9:36 am
by Fred
I see, then moved to feature request.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 10:25 am
by walbus
Yep, Wilbert, this is it.
It thoughts me it with MMX and other optimizations in the module.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 11:28 am
by wilbert
walbus wrote:Yep, Wilbert, this is it.
It thoughts me it with MMX and other optimizations in the module.
The fastest one in that thread is the one optimized for x64 http://www.purebasic.fr/english/viewtop ... 88#p464988 but you are right that the MMX one is also faster as the PB implementation.
A big advantage of the PB implementation is that it will run on very old hardware as well.

Since all x64 processors support MMX, SSE1 and SSE2, it would be nice if the x64 versions of PureBasic would use optimized versions of the C sources if available.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 1:53 pm
by walbus
Yep Wilbert, this SHA3 Module is a great work, fantastic !
This module for x64, yuo write above, i have tested in my code in this summer.
I have become a Assembler Error.
Unfortunately, my latest Assembler programming was with a Commodore 64 - LOL.

Now, this Weekend i test it again inside my new code.

If you want, i can you send the error result with PN, i think for you it is no problem to fix it.

But, i must test it before again.

I write you the result and the resulted speed up so far it works.

I have encoded a video for testing, about 1.35GB (My test Video)
With the SHA3 Module about 18 sek, with the PB540 coder about 36 sek, this is a lot !
I create hashes on demand and include the result in the encrypted containers, this is unmanipulable.
Check is then automatic, after the decryption, it works great, quick and absolutely sure for authentication the content.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 2:05 pm
by wilbert
walbus wrote:If you want, i can you send the error result with PN, i think for you it is no problem to fix it.
If there is a compile error with my code, I would appreciate it if you have some test code causing the error so I can try to fix it.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 2:19 pm
by walbus
Great, i try it, i have some free time today.

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 3:46 pm
by walbus
Ready and all OK Wilbert, 18% speed up with the x64 module !

Re: SHA3 speed PB540 include vs SHA3 module ?

Posted: Fri Nov 20, 2015 8:16 pm
by GPI
wilbert wrote:A big advantage of the PB implementation is that it will run on very old hardware as well.
In the compiler-Option is a an option to select which level of addtitional CPU-things should the created exe support, also a dynamic one. It should be possible, that a PB-exe detect which things the cpu support and choose the fastet code.