diff --git a/.github/workflows/aes.yml b/.github/workflows/aes.yml index f9edc7cb..d71fb0da 100644 --- a/.github/workflows/aes.yml +++ b/.github/workflows/aes.yml @@ -16,6 +16,7 @@ defaults: env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Dwarnings" + SDE_FULL_VERSION: "9.33.0-2024-01-07" jobs: # Builds for no_std platforms @@ -59,7 +60,7 @@ jobs: minimal-versions: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: ${{ github.workflow }} + working-directory: ${{ github.workflow }} # Tests for the AES-NI backend aesni: @@ -96,6 +97,82 @@ jobs: - run: cargo test --target ${{ matrix.target }} --features hazmat - run: cargo test --target ${{ matrix.target }} --all-features + # Tests for the VAES AVX backend + vaes256: + runs-on: ubuntu-latest + env: + CARGO_INCREMENTAL: 0 + strategy: + matrix: + include: + - target: x86_64-unknown-linux-gnu + rust: nightly-2024-02-13 + steps: + - uses: actions/checkout@v4 + - uses: silvanshade/rustcrypto-actions/intel-sde-install@master + with: + sde-full-version: ${{ env.SDE_FULL_VERSION }} + - uses: RustCrypto/actions/cargo-cache@master + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + targets: ${{ matrix.target }} + # NOTE: Write a `.cargo/config.toml` to configure the target for VAES + # NOTE: We use intel-sde as the runner since not all GitHub CI hosts support AVX512 + - name: write .cargo/config.toml + shell: bash + run: | + cd ../aes/.. + mkdir -p .cargo + echo '[target.${{ matrix.target }}]' > .cargo/config.toml + echo 'runner = "sde64 -icl --"' >> .cargo/config.toml + echo 'rustflags = [' >> .cargo/config.toml + echo ' "-Dwarnings",' >> .cargo/config.toml + echo ' "-C", "target-cpu=icelake-client",' >> .cargo/config.toml + echo ']' >> .cargo/config.toml + - run: ${{ matrix.deps }} + - run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} + - run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --features hazmat + - run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --all-features + + # Tests for the VAES AVX512 backend + vaes512: + runs-on: ubuntu-latest + env: + CARGO_INCREMENTAL: 0 + strategy: + matrix: + include: + - target: x86_64-unknown-linux-gnu + rust: nightly-2024-02-13 + steps: + - uses: actions/checkout@v4 + - uses: silvanshade/rustcrypto-actions/intel-sde-install@master + with: + sde-full-version: ${{ env.SDE_FULL_VERSION }} + - uses: RustCrypto/actions/cargo-cache@master + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + targets: ${{ matrix.target }} + # NOTE: Write a `.cargo/config.toml` to configure the target for VAES + # NOTE: We use intel-sde as the runner since not all GitHub CI hosts support AVX512 + - name: write .cargo/config.toml + shell: bash + run: | + cd ../aes/.. + mkdir -p .cargo + echo '[target.${{ matrix.target }}]' > .cargo/config.toml + echo 'runner = "sde64 -icl --"' >> .cargo/config.toml + echo 'rustflags = [' >> .cargo/config.toml + echo ' "-Dwarnings",' >> .cargo/config.toml + echo ' "-C", "target-cpu=icelake-client",' >> .cargo/config.toml + echo ']' >> .cargo/config.toml + - run: ${{ matrix.deps }} + - run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} + - run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --features hazmat + - run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --all-features + # Tests for CPU feature autodetection with fallback to portable software implementation autodetect: runs-on: ubuntu-latest @@ -159,7 +236,6 @@ jobs: - run: cargo test --target ${{ matrix.target }} - run: cargo test --target ${{ matrix.target }} --all-features - # Cross-compiled tests cross: strategy: