@@ -16,6 +16,7 @@ defaults:
1616env :
1717 CARGO_INCREMENTAL : 0
1818 RUSTFLAGS : " -Dwarnings"
19+ SDE_FULL_VERSION : " 9.53.0-2025-03-16"
1920
2021# Cancels CI jobs when new commits are pushed to a PR branch
2122concurrency :
7374 env :
7475 CARGO_INCREMENTAL : 0
7576 RUSTDOCFLAGS : " -C target-feature=+aes,+ssse3"
76- RUSTFLAGS : " -Dwarnings -C target-feature=+aes,+ssse3"
77+ RUSTFLAGS : " -Dwarnings -C target-feature=+aes,+ssse3 --cfg aes_avx512_disable --cfg aes_avx256_disable "
7778 strategy :
7879 matrix :
7980 include :
@@ -102,6 +103,85 @@ jobs:
102103 - run : cargo test --target ${{ matrix.target }} --features hazmat
103104 - run : cargo test --target ${{ matrix.target }} --all-features
104105
106+ # Tests for the VAES AVX backend
107+ vaes256 :
108+ runs-on : ubuntu-latest
109+ strategy :
110+ matrix :
111+ include :
112+ - target : x86_64-unknown-linux-gnu
113+ rust : stable
114+ RUSTFLAGS : " -Dwarnings --cfg aes_avx256"
115+ env :
116+ CARGO_INCREMENTAL : 0
117+ RUSTFLAGS : ${{ matrix.RUSTFLAGS }}
118+ steps :
119+ - uses : actions/checkout@v4
120+ - name : Install Intel SDE
121+ run : |
122+ curl -JLO "https://downloadmirror.intel.com/850782/sde-external-${{ env.SDE_FULL_VERSION }}-lin.tar.xz"
123+ tar xvf sde-external-${{ env.SDE_FULL_VERSION }}-lin.tar.xz -C /opt
124+ echo "/opt/sde-external-${{ env.SDE_FULL_VERSION }}-lin" >> $GITHUB_PATH
125+ - uses : RustCrypto/actions/cargo-cache@master
126+ - uses : dtolnay/rust-toolchain@master
127+ with :
128+ toolchain : ${{ matrix.rust }}
129+ targets : ${{ matrix.target }}
130+ # NOTE: Write a `.cargo/config.toml` to configure the target for VAES
131+ # NOTE: We use intel-sde as the runner since not all GitHub CI hosts support AVX512
132+ - name : write .cargo/config.toml
133+ shell : bash
134+ run : |
135+ cd ../aes/..
136+ mkdir -p .cargo
137+ echo '[target.${{ matrix.target }}]' > .cargo/config.toml
138+ echo 'runner = "sde64 -future --"' >> .cargo/config.toml
139+ - run : ${{ matrix.deps }}
140+ - run : cargo test --target ${{ matrix.target }}
141+ - run : cargo test --target ${{ matrix.target }} --features hazmat
142+ - run : cargo test --target ${{ matrix.target }} --all-features
143+
144+ # Tests for the VAES AVX512 backend
145+ vaes512 :
146+ runs-on : ubuntu-latest
147+ strategy :
148+ matrix :
149+ include :
150+ - target : x86_64-unknown-linux-gnu
151+ rust : stable
152+ RUSTFLAGS : " -Dwarnings --cfg aes_avx512"
153+ - target : x86_64-unknown-linux-gnu
154+ rust : stable
155+ RUSTFLAGS : " -Dwarnings --cfg aes_avx256 --cfg aes_avx512"
156+ env :
157+ CARGO_INCREMENTAL : 0
158+ RUSTFLAGS : ${{ matrix.RUSTFLAGS }}
159+ steps :
160+ - uses : actions/checkout@v4
161+ - name : Install Intel SDE
162+ run : |
163+ curl -JLO "https://downloadmirror.intel.com/850782/sde-external-${{ env.SDE_FULL_VERSION }}-lin.tar.xz"
164+ tar xvf sde-external-${{ env.SDE_FULL_VERSION }}-lin.tar.xz -C /opt
165+ echo "/opt/sde-external-${{ env.SDE_FULL_VERSION }}-lin" >> $GITHUB_PATH
166+ - uses : RustCrypto/actions/cargo-cache@master
167+ - uses : dtolnay/rust-toolchain@master
168+ with :
169+ toolchain : ${{ matrix.rust }}
170+ targets : ${{ matrix.target }}
171+ # NOTE: Write a `.cargo/config.toml` to configure the target for VAES
172+ # NOTE: We use intel-sde as the runner since not all GitHub CI hosts support AVX512
173+ - name : write .cargo/config.toml
174+ shell : bash
175+ run : |
176+ cd ../aes/..
177+ mkdir -p .cargo
178+ echo '[target.${{ matrix.target }}]' > .cargo/config.toml
179+ echo 'runner = "sde64 -future --"' >> .cargo/config.toml
180+ - run : ${{ matrix.deps }}
181+ - run : cargo test --target ${{ matrix.target }}
182+ - run : cargo test --target ${{ matrix.target }} --features hazmat
183+ - run : cargo test --target ${{ matrix.target }} --all-features
184+
105185 # Tests for CPU feature autodetection with fallback to portable software implementation
106186 autodetect :
107187 runs-on : ubuntu-latest
@@ -165,7 +245,6 @@ jobs:
165245 - run : cargo test --target ${{ matrix.target }}
166246 - run : cargo test --target ${{ matrix.target }} --all-features
167247
168-
169248 # Cross-compiled tests
170249 cross :
171250 strategy :
0 commit comments