diff --git a/.github/workflows/md5.yml b/.github/workflows/md5.yml index 991c6bf..3a6321e 100644 --- a/.github/workflows/md5.yml +++ b/.github/workflows/md5.yml @@ -8,49 +8,67 @@ on: push: branches: master +defaults: + run: + working-directory: md5 + env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Dwarnings" jobs: - test: + # Linux tests + linux: strategy: matrix: include: # 32-bit Linux/x86 - target: i686-unknown-linux-gnu - platform: ubuntu-latest - toolchain: 1.41.0 # MSRV + toolchain: 1.43.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - platform: ubuntu-latest toolchain: stable deps: sudo apt install gcc-multilib # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest - toolchain: 1.41.0 # MSRV + toolchain: 1.43.0 # MSRV deps: true - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest toolchain: stable deps: true - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true - # NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute - # See: https://github.com/actions-rs/cargo/pull/59 - - uses: marcopolo/cargo@master + - run: ${{ matrix.deps }} + - run: cargo test --target ${{ matrix.target }} --release + + # Windows tests + windows: + strategy: + matrix: + include: + # 64-bit Windows (GNU) + - target: x86_64-pc-windows-gnu + toolchain: 1.43.0 # MSRV + - target: x86_64-pc-windows-gnu + toolchain: stable + + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 with: - command: test - working-directory: md5 - args: --target ${{ matrix.target }} --release + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + - uses: msys2/setup-msys2@v2 + - run: cargo test --target ${{ matrix.target }} --release diff --git a/.github/workflows/sha1.yml b/.github/workflows/sha1.yml index 6639223..1b94798 100644 --- a/.github/workflows/sha1.yml +++ b/.github/workflows/sha1.yml @@ -8,66 +8,88 @@ on: push: branches: master +defaults: + run: + working-directory: sha1 + env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Dwarnings" jobs: - test: + # Linux tests + linux: strategy: matrix: include: # 32-bit Linux/x86 - target: i686-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false + rust: 1.43.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false deps: sudo apt install gcc-multilib # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false - deps: true + rust: 1.43.0 # MSRV - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false - deps: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: ${{ matrix.deps }} + - run: cargo test --target ${{ matrix.target }} --release + + # Windows tests + windows: + strategy: + matrix: + include: + # 64-bit Windows (GNU) + - target: x86_64-pc-windows-gnu + toolchain: 1.43.0 # MSRV + - target: x86_64-pc-windows-gnu + toolchain: stable + + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + - uses: msys2/setup-msys2@v2 + - run: cargo test --target ${{ matrix.target }} --release + + # Cross-compiled tests + cross: + strategy: + matrix: + include: # ARM64 - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: true - deps: true + rust: 1.43.0 # MSRV - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: true - deps: true - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true - # NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute - # See: https://github.com/actions-rs/cargo/pull/59 - - uses: marcopolo/cargo@master - with: - command: test - working-directory: sha1 - use-cross: ${{ matrix.use_cross }} - args: --target ${{ matrix.target }} --release + - run: cargo install cross + - run: cross test --target ${{ matrix.target }} --release diff --git a/.github/workflows/sha2.yml b/.github/workflows/sha2.yml index c46d1e1..6fc8c58 100644 --- a/.github/workflows/sha2.yml +++ b/.github/workflows/sha2.yml @@ -17,61 +17,79 @@ env: RUSTFLAGS: "-Dwarnings" jobs: - test: + # Linux tests + linux: strategy: matrix: include: # 32-bit Linux/x86 - target: i686-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false + rust: 1.43.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false deps: sudo apt install gcc-multilib # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false - deps: true + rust: 1.43.0 # MSRV - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false - deps: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: ${{ matrix.deps }} + - run: cargo test --target ${{ matrix.target }} --release + + # Windows tests + windows: + strategy: + matrix: + include: + # 64-bit Windows (GNU) + - target: x86_64-pc-windows-gnu + toolchain: 1.43.0 # MSRV + - target: x86_64-pc-windows-gnu + toolchain: stable + + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + - uses: msys2/setup-msys2@v2 + - run: cargo test --target ${{ matrix.target }} --release + + # Cross-compiled tests + cross: + strategy: + matrix: + include: # ARM64 - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: true - deps: true + rust: 1.43.0 # MSRV - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: true - deps: true - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true - # NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute - # See: https://github.com/actions-rs/cargo/pull/59 - - uses: marcopolo/cargo@master - with: - command: test - working-directory: sha1 - use-cross: ${{ matrix.use_cross }} - args: --target ${{ matrix.target }} --release + - run: cargo install cross + - run: cross test --target ${{ matrix.target }} --release diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 644a385..7851774 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -17,7 +17,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.41.0 # MSRV + toolchain: 1.43.0 # MSRV components: clippy override: true - run: cargo clippy --all -- -D warnings diff --git a/Cargo.lock b/Cargo.lock index 6092935..c858659 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +# [[package]] name = "cc" version = "1.0.61" diff --git a/README.md b/README.md index e82da7b..12972a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# RustCrypto: ASM hashes [![Project Chat][chat-image]][chat-link] +# RustCrypto: ASM hashes ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] Assembly implementations of hash functions core functionality based on code from [Project Nayuki](https://www.nayuki.io/). @@ -9,6 +9,23 @@ functionality please refer to the crates from enabled `asm` feature `md5`, `sha-1`, `sha2` and `whirlpool` crates will use code from this repository. +## Supported Platforms + +All crates are tested on the following platforms: + +- Linux (32-bit and 64-bit x86) +- Windows (64-bit x86, GNU only) +- ARM64 (except `md5`, which is x86 only) + +Windows MSVC builds are known to be broken. See [#17]. + +## Minimum Supported Rust Version + +All crates in this repository support **Rust 1.43** or higher. + +In the future when the minimum supported Rust version is changed, +it will be accompanied by a minor version bump. + ## License All crates licensed under the [MIT license](http://opensource.org/licenses/MIT). @@ -21,5 +38,10 @@ dual licensed as above, without any additional terms or conditions. [//]: # (badges) +[rustc-image]: https://img.shields.io/badge/rustc-1.43+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes + +[//]: # (general links) + +[#17]: https://github.com/RustCrypto/asm-hashes/issues/17