mirror of
https://github.com/logos-blockchain/sponges.git
synced 2026-07-30 10:33:21 +00:00
Also fixes a warning for the ARMv8 `asm!` backend:
error[E0133]: use of inline assembly is unsafe and requires unsafe block
--> keccak/src/armv8.rs:8:5
|
8 | / core::arch::asm!("
9 | | // Read state
10 | | ld1.1d {{ v0- v3}}, [x0], #32
11 | | ld1.1d {{ v4- v7}}, [x0], #32
... |
119 | | options(nostack)
120 | | );
| |_____^ use of inline assembly
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
= note: inline assembly is entirely unchecked and can cause undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> keccak/src/armv8.rs:7:1
|
7 | pub unsafe fn p1600_armv8_sha3_asm(state: &mut [u64; 25], round_count: usize) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D unsafe-op-in-unsafe-fn` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unsafe_op_in_unsafe_fn)]`
For more information about this error, try `rustc --explain E0133`.
155 lines
4.7 KiB
YAML
155 lines
4.7 KiB
YAML
name: keccak
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/keccak.yml"
|
|
- "keccak/**"
|
|
- "Cargo.*"
|
|
push:
|
|
branches: master
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: keccak
|
|
|
|
env:
|
|
RUSTFLAGS: "-Dwarnings"
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
set-msrv:
|
|
uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master
|
|
with:
|
|
msrv: 1.85.0
|
|
|
|
build:
|
|
needs: set-msrv
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rust:
|
|
- ${{needs.set-msrv.outputs.msrv}}
|
|
- stable
|
|
target:
|
|
- thumbv7em-none-eabi
|
|
- wasm32-unknown-unknown
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: RustCrypto/actions/cargo-cache@master
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
targets: ${{ matrix.target }}
|
|
- run: cargo build --no-default-features --target ${{ matrix.target }}
|
|
|
|
minimal-versions:
|
|
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
|
|
with:
|
|
working-directory: ${{ github.workflow }}
|
|
stable-cmd: cargo hack test --release --feature-powerset --skip simd # `simd` requires nightly
|
|
|
|
test:
|
|
needs: set-msrv
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# AMD64 Linux
|
|
- target: x86_64-unknown-linux-gnu
|
|
platform: ubuntu-latest
|
|
rust: ${{needs.set-msrv.outputs.msrv}}
|
|
- target: x86_64-unknown-linux-gnu
|
|
platform: ubuntu-latest
|
|
rust: stable
|
|
# ARM64 macOS
|
|
- target: aarch64-apple-darwin
|
|
platform: macos-latest
|
|
rust: ${{needs.set-msrv.outputs.msrv}}
|
|
- target: aarch64-apple-darwin
|
|
platform: macos-latest
|
|
rust: stable
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: RustCrypto/actions/cargo-cache@master
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
targets: ${{ matrix.target }}
|
|
- run: cargo check --no-default-features --target ${{ matrix.target }}
|
|
- run: cargo check --features asm,no_unroll --target ${{ matrix.target }}
|
|
- run: cargo test --no-default-features --target ${{ matrix.target }}
|
|
- run: cargo test --target ${{ matrix.target }}
|
|
- run: cargo test --features asm --target ${{ matrix.target }}
|
|
- run: cargo test --features no_unroll --target ${{ matrix.target }}
|
|
- run: cargo test --features asm,no_unroll --target ${{ matrix.target }}
|
|
|
|
test-simd:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: RustCrypto/actions/cargo-cache@master
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly
|
|
- run: cargo check --features simd
|
|
- run: cargo test --features simd
|
|
|
|
miri:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MIRIFLAGS: "-Zmiri-symbolic-alignment-check -Zmiri-strict-provenance"
|
|
strategy:
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-gnu
|
|
- s390x-unknown-linux-gnu
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly
|
|
- name: Install Miri
|
|
run: |
|
|
rustup component add miri
|
|
cargo miri setup
|
|
- name: Test with Miri
|
|
run: |
|
|
cargo miri test --target ${{ matrix.target }} --no-default-features
|
|
cargo miri test --target ${{ matrix.target }}
|
|
cargo miri test --target ${{ matrix.target }} --features no_unroll
|
|
cargo miri test --target ${{ matrix.target }} --features simd
|
|
|
|
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@v4
|
|
- uses: RustCrypto/actions/cargo-cache@master
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
targets: aarch64-unknown-linux-gnu
|
|
- 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
|