Commit Graph

9 Commits

Author SHA1 Message Date
Tobias Brunner 3f8eb2ebdf aesni: Remove useless algorithm assignments 2020-08-18 13:17:24 +02:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Martin Willi 37794878cc aesni: Avoid loading AES/GHASH round keys into local variables
The performance impact is not measurable, as the compiler loads these variables
in xmm registers in unrolled loops anyway.

However, we avoid loading these sensitive keys onto the stack. This happens for
larger key schedules, where the register count is insufficient. If that key
material is not on the stack, we can avoid to wipe it explicitly after
crypto operations.
2015-04-15 13:44:40 +02:00
Martin Willi 93f0080265 aesni: Align all class instances to 16 byte boundaries
While the required members are aligned in the struct as required, on 32-bit
platforms the allocator aligns the structures itself to 8 bytes only. This
results in non-aligned struct members, and invalid memory accesses.
2015-04-15 13:44:40 +02:00
Martin Willi edab6c658c aesni: Calculate GHASH for 4 blocks of associated data in parallel
While associated data is usually not that large, in some specific cases
this can bring a significant performance boost.
2015-04-15 11:35:28 +02:00
Martin Willi 0eb593b0bb aesni: Calculate GHASH for 4 blocks of encryption data in parallel
Increases performance by another ~30%.
2015-04-15 11:35:28 +02:00
Martin Willi 58c44cdd00 aesni: Use 4-way parallel en/decryption in GCM
Increases overall performance by ~25%.
2015-04-15 11:35:28 +02:00
Martin Willi 677649cfb5 aesni: Use dedicated key size specific en-/decryption functions in GCM
This gives not much more than ~5% increase in performance, but allows us to
improve further.
2015-04-15 11:35:28 +02:00
Martin Willi 313811b72d aesni: Add a GCM AEAD based on the AES-NI key schedule 2015-04-15 11:35:28 +02:00