freebsd-src/sys/crypto
Mark Johnston 9a3444d91c ossl: Add a VAES-based AES-GCM implementation for amd64
aes-gcm-avx512.S is generated from OpenSSL 3.1 and implements AES-GCM.
ossl_x86.c detects whether the CPU implements the required AVX512
instructions; if not, the ossl(4) module does not provide an AES-GCM
implementation.  The VAES implementation increases throughput for all
buffer sizes in both directions, up to 2x for sufficiently large
buffers.

The "process" implementation is in two parts: a generic OCF layer in
ossl_aes.c that calls a set of MD functions to do the heavy lifting.
The intent there is to make it possible to add other implementations for
other platforms, e.g., to reduce the diff required for D37421.

A follow-up commit will add a fallback path to legacy AES-NI, so that
ossl(4) can be used in preference to aesni(4) on all amd64 platforms.
In the long term we would like to replace aesni(4) and armv8crypto(4)
with ossl(4).

Note, currently this implementation will not be selected by default
since aesni(4) and ossl(4) return the same probe priority for crypto
sessions, and the opencrypto framework selects the first registered
implementation to break a tie.  Since aesni(4) is compiled into the
kernel, aesni(4) wins.  A separate change may modify ossl(4) to have
priority.

Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Reviewed by:	jhb
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D39783
2023-06-02 12:15:01 -04:00
..
aesni aesni: Remove misleading array bounds for aesni_decryt_ecb. 2022-12-07 12:32:19 -08:00
armv8 Fix the IV length in the armv8 AES GCM code 2022-09-06 13:11:04 +01:00
blake2 crypto: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:58 -07:00
camellia crypto(4): Fix a few typos in camellia.c 2021-09-04 13:02:11 +02:00
ccp spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
chacha20 crypto: Re-add encrypt/decrypt_multi hooks to enc_xform. 2022-01-11 14:17:41 -08:00
des Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
libsodium crypto: Add an API supporting curve25519. 2022-01-24 15:27:39 -08:00
openssl ossl: Add a VAES-based AES-GCM implementation for amd64 2023-06-02 12:15:01 -04:00
rc4
rijndael sys/crypto: Use C99 fixed-width integer types. 2021-12-28 09:41:38 -08:00
sha2 sha512_224: Fix SHA512_224_Final() on little-endian machines. 2023-02-06 18:02:49 +01:00
siphash
skein skein: Update guard define check 2022-07-24 16:53:35 -06:00
via crypto: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:58 -07:00
chacha20_poly1305.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
chacha20_poly1305.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
curve25519.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
curve25519.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
intake.h
sha1.c Replace some K&R function definitions with ANSI C. 2020-11-03 22:32:30 +00:00
sha1.h Consistently use C99 fixed-width types in the in-kernel crypto code. 2020-11-03 22:27:54 +00:00