freebsd-dev/share
Conrad Meyer fe182ba1d0 aesni(4): Add support for x86 SHA intrinsics
Some x86 class CPUs have accelerated intrinsics for SHA1 and SHA256.
Provide this functionality on CPUs that support it.

This implements CRYPTO_SHA1, CRYPTO_SHA1_HMAC, and CRYPTO_SHA2_256_HMAC.

Correctness: The cryptotest.py suite in tests/sys/opencrypto has been
enhanced to verify SHA1 and SHA256 HMAC using standard NIST test vectors.
The test passes on this driver.  Additionally, jhb's cryptocheck tool has
been used to compare various random inputs against OpenSSL.  This test also
passes.

Rough performance averages on AMD Ryzen 1950X (4kB buffer):
aesni:      SHA1: ~8300 Mb/s    SHA256: ~8000 Mb/s
cryptosoft:       ~1800 Mb/s    SHA256: ~1800 Mb/s

So ~4.4-4.6x speedup depending on algorithm choice.  This is consistent with
the results the Linux folks saw for 4kB buffers.

The driver borrows SHA update code from sys/crypto sha1 and sha256.  The
intrinsic step function comes from Intel under a 3-clause BSDL.[0]  The
intel_sha_extensions_sha<foo>_intrinsic.c files were renamed and lightly
modified (added const, resolved a warning or two; included the sha_sse
header to declare the functions).

[0]: https://software.intel.com/en-us/articles/intel-sha-extensions-implementations

Reviewed by:	jhb
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12452
2017-09-26 23:12:32 +00:00
..
colldef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
ctypedef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
dict
doc In preparation for the removal of the roff toolchain, disconnect the 2017-05-25 14:54:22 +00:00
dtrace Remove redefinitions of some kernel types from mbuf.d. 2016-09-03 20:43:59 +00:00
examples Add HAS_TESTS to all Makefiles that are currently using the 2017-08-02 08:50:42 +00:00
i18n share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
man aesni(4): Add support for x86 SHA intrinsics 2017-09-26 23:12:32 +00:00
misc Add myself as src committer. 2017-09-23 19:49:12 +00:00
mk Use OBJS_SRCS_FILTER to control setting OBJS from SRCS 2017-09-16 05:42:27 +00:00
monetdef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
msgdef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
numericdef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
security
sendmail share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
skel Cosmetic tweaks to the default shell rc files, mostly comments. 2017-07-05 13:08:07 +00:00
snmp
syscons Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
tabset
termcap Revert r314833 until the problem with INSTALL_RSYMLINKS can be found 2017-03-12 00:37:45 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
timedef Canada adheres to ISO 8601, let's make the locale reflecting that fact 2017-03-19 18:21:35 +00:00
vt Adjust path to X11 locale files (/usr/X11 has been changed to /usr/local a 2017-08-01 09:34:15 +00:00
zoneinfo Add HAS_TESTS to all Makefiles that are currently using the 2017-08-02 08:50:42 +00:00
Makefile Convert traditional ${MK_TESTS} conditional idiom for including test 2017-08-02 08:35:51 +00:00
Makefile.inc