Skip to content

AEGIS x86 assembly tuning

Eric Biggers linux-crypto lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 1 replyIn review
  2. v110 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Put assoclen and cryptlen in the correct order in the prototype of aegis128_aesni_final().
- Expanded commit message of "eliminate some indirect calls"
- Added Ondrej's Reviewed-by.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10crypto: x86/aegis128 - access 32-bit arguments as 32-bitarch/x86/crypto/aegis128-aesni-asm.S+15 -140 replies
2/10crypto: x86/aegis128 - remove no-op init and exit functionsarch/x86/crypto/aegis128-aesni-glue.c+0 -110 replies
3/10crypto: x86/aegis128 - eliminate some indirect callsarch/x86/crypto/aegis128-aesni-asm.S arch/x86/crypto/aegis128-aesni-glue.c+40 -430 replies
4/10crypto: x86/aegis128 - don't bother with special code for aligned dataarch/x86/crypto/aegis128-aesni-asm.S+22 -1000 replies
5/10crypto: x86/aegis128 - optimize length block preparation using SSE4.1arch/x86/crypto/Kconfig arch/x86/crypto/aegis128-aesni-asm.S arch/x86/crypto/aegis128-aesni-glue.c+7 -90 replies
6/10crypto: x86/aegis128 - improve assembly function prototypesarch/x86/crypto/aegis128-aesni-asm.S arch/x86/crypto/aegis128-aesni-glue.c+112 -850 replies
7/10crypto: x86/aegis128 - optimize partial block handling using SSE4.1arch/x86/crypto/aegis128-aesni-asm.S+95 -1410 replies
8/10crypto: x86/aegis128 - take advantage of block-aligned lenarch/x86/crypto/aegis128-aesni-asm.S arch/x86/crypto/aegis128-aesni-glue.c+17 -240 replies
9/10crypto: x86/aegis128 - remove unneeded FRAME_BEGIN and FRAME_ENDarch/x86/crypto/aegis128-aesni-asm.S+0 -340 replies
10/10crypto: x86/aegis128 - remove unneeded RETsarch/x86/crypto/aegis128-aesni-asm.S+0 -60 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchOndrej Mosnacek
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] AEGIS x86 assembly tuning

This series cleans up the AES-NI optimized implementation of AEGIS-128.

Performance is improved by 1-5% depending on the input lengths. Binary code size is reduced by about 20% (measuring glue + assembly combined), and source code length is reduced by about 150 lines.

The first patch also fixes a bug which could theoretically cause incorrect behavior but was seemingly not being encountered in practice.

Note: future optimizations for AEGIS-128 could involve adding AVX512 / AVX10 optimized assembly code. However, unfortunately due to the way that AEGIS-128 is specified, its level of parallelism is limited, and it can't really take advantage of vector lengths greater than 128 bits. So, probably this would provide only another modest improvement, mostly coming from being able to use the ternary logic instructions.

Changed in v2:
- Put assoclen and cryptlen in the correct order in the prototype of aegis128_aesni_final().
- Expanded commit message of "eliminate some indirect calls"
- Added Ondrej's Reviewed-by.

Eric Biggers (10):
crypto: x86/aegis128 - access 32-bit arguments as 32-bit
crypto: x86/aegis128 - remove no-op init and exit functions
crypto: x86/aegis128 - eliminate some indirect calls
crypto: x86/aegis128 - don't bother with special code for aligned data
crypto: x86/aegis128 - optimize length block preparation using SSE4.1
crypto: x86/aegis128 - improve assembly function prototypes
crypto: x86/aegis128 - optimize partial block handling using SSE4.1
crypto: x86/aegis128 - take advantage of block-aligned len
crypto: x86/aegis128 - remove unneeded FRAME_BEGIN and FRAME_END
crypto: x86/aegis128 - remove unneeded RETs

 arch/x86/crypto/Kconfig               |   4 +-
 arch/x86/crypto/aegis128-aesni-asm.S  | 532 ++++++++++----------------
 arch/x86/crypto/aegis128-aesni-glue.c | 145 ++++---
 3 files changed, 261 insertions(+), 420 deletions(-)

base-commit: 5c20772738e1d1d7bec41664eb9d61497e53c10e

Signature · 1 line
2.47.0