Tobias Brunner
ad8484a6cc
aesni: Make sure to wipe salt
2023-07-26 15:08:33 +02:00
Tobias Brunner
7f46c76125
Make functions static that are only accessed from the same compilation unit
...
Also removed some declarations for undefined functions.
2022-10-05 19:00:46 +02:00
Tobias Brunner
7217ff5fc5
aesni: Fix out-of-bound read when loading 192-bit AES keys
2022-09-15 12:16:12 +02:00
Tobias Brunner
19ef2aec15
Update copyright headers after acquisition by secunet
2022-06-28 10:22:56 +02:00
Tobias Brunner
3f8eb2ebdf
aesni: Remove useless algorithm assignments
2020-08-18 13:17:24 +02:00
Tobias Brunner
26f20cc258
aesni: Namespace include guard for AES-CMAC
...
Was the same as in the cmac plugin.
2020-01-28 15:32:43 +01:00
Andreas Steffen
20f3d04b13
aesni: Added AES_ECB support
2019-11-28 17:03:08 +01:00
Tobias Brunner
1b67166921
Unify format of HSR copyright statements
2018-05-23 16:32:53 +02:00
Andreas Steffen
b12c53ce77
Use standard unsigned integer types
2016-03-24 18:52:48 +01:00
Martin Willi
23947b2a4f
aesni: Fix doxygen groups
2015-04-15 17:29:56 +02: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
Martin Willi
4284660677
aesni: Implement CMAC mode to provide a signer/prf
...
Compared to the cmac plugin using AESNI-CBC as backend, this improves
performance of AES-CMAC by ~45%.
2015-04-15 11:35:28 +02:00
Martin Willi
9d187f8711
aesni: Implement XCBC mode to provide a signer/prf
...
Compared to the xcbc plugin using AESNI-CBC as backend, this improves
performance of AES-XCBC by ~45%.
2015-04-15 11:35:28 +02:00
Martin Willi
d48642b7eb
aesni: Partially use separate code paths for different key sizes in CCM
...
Due to the serial nature of the CBC mac, this brings only a marginal speedup.
2015-04-15 11:35:28 +02:00
Martin Willi
1ae46dfba2
aesni: Add a CCM AEAD reusing the key schedule
2015-04-15 11:35:27 +02:00
Martin Willi
8488dea2f9
aesni: Use 4-way parallel AES-NI instructions for CTR en/decryption
...
CTR can be parallelized, and we do so by queueing instructions to the processor
pipeline. While we have enough registers for 128-bit decryption, the register
count is insufficient to hold all variables with larger key sizes. Nonetheless
is 4-way parallelism faster, depending on key size between ~10% and ~25%.
2015-04-15 11:35:27 +02:00
Martin Willi
9e47c1fe77
aesni: Use dedicated round count specific encryption functions in CTR mode
...
This allows us to unroll loops and hold the key schedule in local (register)
variables. This brings an impressive speedup of ~45%.
2015-04-15 11:35:27 +02:00
Martin Willi
74d43cbde9
aesni: Implement a AES-NI based CTR crypter using the key schedule
2015-04-15 11:35:27 +02:00
Martin Willi
a3cb72e850
aesni: Use 4-way parallel AES-NI instructions for CBC decryption
...
CBC decryption can be parallelized, and we do so by queueing instructions
to the processor pipeline. While we have enough registers for 128-bit
decryption, the register count is insufficient to hold all variables with
larger key sizes. Nonetheless is 4-way parallelism faster, roughly by ~8%.
2015-04-15 11:35:27 +02:00
Martin Willi
95ef361415
aesni: Use separate en-/decryption CBC code paths for different key sizes
...
This allows us to unroll loops, and use local (register) variables for the
key schedule. This improves performance slightly for encryption, but a lot
for reorderable decryption (>30%).
2015-04-15 11:35:27 +02:00
Martin Willi
8f1fab93e9
aesni: Implement a AES-NI based CBC crypter using the key schedule
2015-04-15 11:35:27 +02:00
Martin Willi
b2d96bfe25
aesni: Implement 256-bit key schedule
2015-04-15 11:35:27 +02:00
Martin Willi
d7811415ff
aesni: Implement 192-bit key schedule
2015-04-15 11:35:26 +02:00
Martin Willi
6d7671eb1c
aesni: Implement 128-bit key schedule
2015-04-15 11:35:26 +02:00
Martin Willi
431f452ed4
aesni: Add a common key schedule class for AES
2015-04-15 11:35:26 +02:00
Martin Willi
78c04b5d4d
aesni: Provide a plugin stub for AES-NI instruction based crypto primitives
2015-04-15 11:35:26 +02:00