Skip to content

Commit

Permalink
Add aarch64-sha3 test
Browse files Browse the repository at this point in the history
  • Loading branch information
recmo committed Oct 29, 2022
1 parent 7bc9cfc commit 0f586b0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/keccak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,38 @@ jobs:
package: ${{ github.workflow }}
target: ${{ matrix.target }}
features: ${{ matrix.features }}

aarch64-sha3:
needs: set-msrv
runs-on: ubuntu-latest
defaults:
run:
# Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
working-directory: .
strategy:
matrix:
rust:
- ${{needs.set-msrv.outputs.msrv}}
- stable
steps:
- uses: actions/checkout@v3
- uses: RustCrypto/actions/cargo-cache@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: aarch64-unknown-linux-gnu
override: true
- name: Install pre-compiled cross
run: |
# We need a recent version for RUSTFLAGS to work.
wget -O /tmp/binaries.tar.gz https://github.com/cross-rs/cross/releases/download/v0.2.4/cross-x86_64-unknown-linux-gnu.tar.gz
tar -C /tmp -xzf /tmp/binaries.tar.gz
mv /tmp/cross ~/.cargo/bin
shell: bash
- name: cross test
run: |
cd keccak
# Cross doesn't enable `sha3` by default, but QEMU supports it.
export RUSTFLAGS="-C target-feature=+sha3"
cross test --target aarch64-unknown-linux-gnu --no-default-features
3 changes: 3 additions & 0 deletions keccak/src/aarch64_sha3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pub fn keccak_f1600(state: &mut [u64; 25]) {
sub x0, x0, #192
// Loop 24 rounds
// NOTE: This loop actually computes two f1600 functions in
// parallel, in both the lower and the upper 64-bit of the
// 128-bit registers v0-v24.
mov x8, #24
0: sub x8, x8, #1
Expand Down

0 comments on commit 0f586b0

Please sign in to comment.