Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jan 2019 19:41:01 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        Stefan Ehmann <shoesoft@gmx.net>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: sha256 speed
Message-ID:  <CAG6CVpXBtTSSZg4MSURo0UQjLV0AREVMmw297aQCRDnO4vQp9g@mail.gmail.com>
In-Reply-To: <1d3be715-acc7-4879-02a2-4fddea802027@gmx.net>
References:  <1d3be715-acc7-4879-02a2-4fddea802027@gmx.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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&revision=r324037
.

Best,
Conrad

On Sun, Jan 6, 2019 at 4:19 PM Stefan Ehmann <shoesoft@gmx.net> 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-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpXBtTSSZg4MSURo0UQjLV0AREVMmw297aQCRDnO4vQp9g>