1
1
This is a pure-Rust platform-agnostic [ AES] ( https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf ) library, that
2
2
is focused on reusability and optimal performance.
3
3
4
- This library guarantees the best performance on the ` target_cpu ` (if correctly specified). This currently has 6
4
+ This library guarantees the best performance on the ` target_cpu ` (if correctly specified). This currently has 7
5
5
implementations, among which it automatically decides the best (most performant) using Cargo's ` target_feature ` flags.
6
6
7
7
# The implementations and their requirements are:
8
8
9
9
- AES-NI (with Vector AES for 2- and 4- blocks) => requires a Nightly Compiler, the ` nightly ` feature to be enabled, and
10
10
compiling for x86(64) with the ` avx512f ` and ` vaes ` target_feature flags set.
11
11
- AES-NI (with Vector AES for 2-blocks) => requires a Nightly Compiler, the ` nightly ` feature to be enabled, and
12
- compiling for x86(64) with the ` vaes ` target_feature flag set. (although ` vaes ` is an AVX-512 feature, some AlderLake
13
- CPUs have ` vaes ` without AVX-512 support)
12
+ compiling for x86(64) with the ` vaes ` target_feature flag set.
14
13
- AES-NI => requires compiling for x86(64) with the ` sse4.1 ` and ` aes ` target_feature flags set.
15
14
- AES-Neon => requires compiling for AArch64 or ARM64EC or ARM-v8 with the ` aes ` target_feature flag set (ARM-v8
16
15
requires a Nightly compiler and the ` nightly ` feature to be enabled) .
@@ -19,6 +18,9 @@ implementations, among which it automatically decides the best (most performant)
19
18
target-feature enabled)
20
19
- Software AES => fallback implementation based on Rijmen and Daemen's ` optimized ` implementation (available
21
20
on [ their website] ( https://web.archive.org/web/20050828204927/http://www.iaik.tu-graz.ac.at/research/krypto/AES/old/%7Erijmen/rijndael/ ) )
21
+ - Constant-time Software AES => Much slower than Software AES, but is constant-time, which can be important in some scenarios.
22
+ Enabled by the ` constant-time ` feature. It is worth noting that all the accelerated AES implementations are constant-time, so this
23
+ only comes into play when no accelerated version is found.
22
24
23
25
If you are unsure about the target_feature flags to set, use ` target_cpu=native ` (if not cross-compiling) in
24
26
the ` RUSTFLAGS ` environment variable, and use the ` nightly ` feature only if you are using a nightly compiler.
0 commit comments