Date: Mon, 7 Jan 2019 22:49:35 +0300 From: Rozhuk Ivan <rozhuk.im@gmail.com> To: Stefan Ehmann <shoesoft@gmx.net> Cc: freebsd-current@freebsd.org Subject: Re: sha256 speed Message-ID: <20190107224935.5f9e2b9f@rimwks> 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
On Mon, 7 Jan 2019 01:17:45 +0100 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. 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190107224935.5f9e2b9f>
