freebsd-dev/tests/sys
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
..
acl Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
aio Fix cosmetic issue with error message 2017-08-02 09:49:41 +00:00
fifo Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
file Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
fs Chase r321920 and r321930 (dev_t being widened) 2017-08-03 03:43:41 +00:00
geom Add supporting changes for Add limited sandbox capability to "make check" 2017-08-14 19:21:37 +00:00
kern Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
kqueue Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
mac Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
mqueue Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
netinet tests/sys/netinet/fibs_test: skip selected tests when firewalls are enabled 2017-08-08 15:37:21 +00:00
opencrypto aesni(4): Add support for x86 SHA intrinsics 2017-09-26 23:12:32 +00:00
pjdfstest Use MK_CHECK_USE_SANDBOX in tests/..., to deal with the fact that 2017-08-02 22:24:08 +00:00
posixshm Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
sys DIRDEPS_BUILD: Add some missing dirctories to the build. 2016-08-31 19:30:59 +00:00
vfs Make test scripts under tests/... non-executable 2017-08-08 04:59:16 +00:00
vm Revert r313565 -- :mmap__bad_arguments passes again after r313655 2017-02-11 20:31:57 +00:00
Makefile Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite 2016-10-21 05:24:08 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
Makefile.inc Use MK_CHECK_USE_SANDBOX in tests/..., to deal with the fact that 2017-08-02 22:24:08 +00:00