freebsd-dev/sys/crypto
Mark Johnston 26b08c5d21 armv8crypto: Use cursors to access crypto buffer data
Currently armv8crypto copies the scheme used in aesni(9), where payload
data and output buffers are allocated on the fly if the crypto buffer is
not virtually contiguous.  This scheme is simple but incurs a lot of
overhead: for an encryption request with a separate output buffer we
have to
- allocate a temporary buffer to hold the payload
- copy input data into the buffer
- copy the encrypted payload to the output buffer
- zero the temporary buffer before freeing it

We have a handy crypto buffer cursor abstraction now, so reimplement the
armv8crypto routines using that instead of temporary buffers.  This
introduces some extra complexity, but gallatin@ reports a 10% throughput
improvement with a KTLS workload without additional CPU usage.  The
driver still allocates an AAD buffer for AES-GCM if necessary.

Reviewed by:	jhb
Tested by:	gallatin
Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D28950
2022-02-15 21:50:41 -05:00
..
aesni aesni: Fix an out-of-bounds read in AES_GCM_decrypt() 2021-12-16 09:17:06 -05:00
armv8 armv8crypto: Use cursors to access crypto buffer data 2022-02-15 21:50:41 -05:00
blake2 cryptosoft: Fully support per-operation keys for auth algorithms. 2021-12-09 11:52:42 -08:00
camellia crypto(4): Fix a few typos in camellia.c 2021-09-04 13:02:11 +02:00
ccp crypto: Validate AES-GCM IV length in check_csp(). 2021-12-09 11:52:41 -08: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 Add assembly optimized code for OpenSSL on powerpc, powerpc64 and powerpc64le 2021-11-23 23:26:53 +01:00
rc4
rijndael sys/crypto: Use C99 fixed-width integer types. 2021-12-28 09:41:38 -08:00
sha2 Add accelerated arm64 sha512 to libmd 2021-12-13 15:33:22 +00:00
siphash
skein Consistently use C99 fixed-width types in the in-kernel crypto code. 2020-11-03 22:27:54 +00:00
via crypto: Constify all transform descriptors 2021-07-26 16:41:05 -04:00
chacha20_poly1305.c chacha20_poly1305: Use the correct license disclaimer. 2022-01-20 14:36:48 -08:00
chacha20_poly1305.h chacha20_poly1305: Use the correct license disclaimer. 2022-01-20 14:36:48 -08:00
curve25519.c crypto: Add an API supporting curve25519. 2022-01-24 15:27:39 -08:00
curve25519.h crypto: Add an API supporting curve25519. 2022-01-24 15:27:39 -08:00
intake.h Implement boot-time encryption key passing (keybuf) 2017-04-01 05:05:22 +00:00
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