Re: sha256 speed

2019-01-07 Thread Rozhuk Ivan
On Mon, 7 Jan 2019 01:17:45 +0100
Stefan Ehmann  wrote:

> Hello,
> 
> On my Ryzen the sha256 command is much slower than openssl dgst
> -sha256. For large files, openssl is more than 7 times faster in
> practice.
> 
> You can also test it with the builtin benchmarks:
> sha256 -t
> openssl speed sha256
> 
> I think the reason is that openssl supports the SHA CPU extensions
> whereas libmd (used by sha256) does not.
> 
> Any chance we can make the base sha256 faster?
> I guess there is some reason why we use libmd instead of openssl.
> 
> https://reviews.freebsd.org/D2651 looks related but not sure it's
> still relevant.


Do not look into FreeBSD code )
You can take mine code: 
https://github.com/rozhuk-im/liblcb/blob/master/include/crypto/hash/sha2.h
there is Plain C and SHA versions.
I see SSE version in internet but do not implement it in mine sha2 code, only 
for sha1 now.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: sha256 speed

2019-01-06 Thread Conrad Meyer
There is support for the SHA intrinsic in aesni(4) that would be
relatively easy to adapt to userspace for libmd, if someone was
interested.  Especially now that we demand linker ifunc support (on
x86 platforms, at least).  I posted a patch and some performance
comparison in https://svnweb.freebsd.org/base?view=revision=r324037
.

Best,
Conrad

On Sun, Jan 6, 2019 at 4:19 PM Stefan Ehmann  wrote:
>
> Hello,
>
> On my Ryzen the sha256 command is much slower than openssl dgst -sha256.
> For large files, openssl is more than 7 times faster in practice.
>
> You can also test it with the builtin benchmarks:
> sha256 -t
> openssl speed sha256
>
> I think the reason is that openssl supports the SHA CPU extensions
> whereas libmd (used by sha256) does not.
>
> Any chance we can make the base sha256 faster?
> I guess there is some reason why we use libmd instead of openssl.
>
> https://reviews.freebsd.org/D2651 looks related but not sure it's still
> relevant.
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: sha256 speed

2019-01-06 Thread Waitman Gobble
Sent from ProtonMail mobile

 Original Message 
On Jan 6, 2019, 8:17 PM, Stefan Ehmann wrote:

Hello,

On my Ryzen the sha256 command is much slower than openssl dgst -sha256.
For large files, openssl is more than 7 times faster in practice.

You can also test it with the builtin benchmarks:
sha256 -t
openssl speed sha256

I think the reason is that openssl supports the SHA CPU extensions
whereas libmd (used by sha256) does not.

Any chance we can make the base sha256 faster?
I guess there is some reason why we use libmd instead of openssl.

https://reviews.freebsd.org/D2651 looks related but not sure it's still
relevant.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Should probably dump sha256 anyways, blake2.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


sha256 speed

2019-01-06 Thread Stefan Ehmann
Hello,

On my Ryzen the sha256 command is much slower than openssl dgst -sha256.
For large files, openssl is more than 7 times faster in practice.

You can also test it with the builtin benchmarks:
sha256 -t
openssl speed sha256

I think the reason is that openssl supports the SHA CPU extensions
whereas libmd (used by sha256) does not.

Any chance we can make the base sha256 faster?
I guess there is some reason why we use libmd instead of openssl.

https://reviews.freebsd.org/D2651 looks related but not sure it's still
relevant.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"