From ef9d527b993a2aa793aab9110741ffa222417833 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 30 May 2020 07:59:06 -0700 Subject: [PATCH] Switch to GitHub Actions; MSRV 1.41+ The MSRV bump is necessary to check in a merge-friendly Cargo.lock (which is helpful for caching). We'll want to do this bump anyway soon for `generic-array` v0.14. See: --- .github/workflows/cmac.yml | 56 ++++++++++ .github/workflows/daa.yml | 53 +++++++++ .github/workflows/hmac.yml | 53 +++++++++ .github/workflows/pmac.yml | 53 +++++++++ .gitignore | 3 - .travis.yml | 37 ------- Cargo.lock | 218 +++++++++++++++++++++++++++++++++++++ cmac/Cargo.toml | 3 - cmac/src/lib.rs | 2 +- hmac/Cargo.toml | 3 - pmac/Cargo.toml | 3 - 11 files changed, 434 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/cmac.yml create mode 100644 .github/workflows/daa.yml create mode 100644 .github/workflows/hmac.yml create mode 100644 .github/workflows/pmac.yml delete mode 100644 .travis.yml create mode 100644 Cargo.lock diff --git a/.github/workflows/cmac.yml b/.github/workflows/cmac.yml new file mode 100644 index 0000000..965991c --- /dev/null +++ b/.github/workflows/cmac.yml @@ -0,0 +1,56 @@ +name: cmac + +on: + pull_request: + paths: + - "cmac/**" + - "Cargo.*" + push: + branches: master + paths: + - "cmac/**" + - "Cargo.*" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - thumbv7em-none-eabi + - wasm32-unknown-unknown + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: cargo build --no-default-features --release --target ${{ matrix.target }} + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Dwarnings" + working-directory: cmac + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - run: cargo test --release + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Dwarnings" + working-directory: cmac diff --git a/.github/workflows/daa.yml b/.github/workflows/daa.yml new file mode 100644 index 0000000..12e8827 --- /dev/null +++ b/.github/workflows/daa.yml @@ -0,0 +1,53 @@ +name: daa + +on: + pull_request: + paths: + - "daa/**" + - "Cargo.*" + push: + branches: master + paths: + - "daa/**" + - "Cargo.*" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - thumbv7em-none-eabi + - wasm32-unknown-unknown + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: cargo build --no-default-features --release --target ${{ matrix.target }} + working-directory: daa + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - run: cargo test --release + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Dwarnings" + working-directory: daa diff --git a/.github/workflows/hmac.yml b/.github/workflows/hmac.yml new file mode 100644 index 0000000..2c59929 --- /dev/null +++ b/.github/workflows/hmac.yml @@ -0,0 +1,53 @@ +name: hmac + +on: + pull_request: + paths: + - "hmac/**" + - "Cargo.*" + push: + branches: master + paths: + - "hmac/**" + - "Cargo.*" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - thumbv7em-none-eabi + - wasm32-unknown-unknown + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: cargo build --no-default-features --release --target ${{ matrix.target }} + working-directory: hmac + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - run: cargo test --release + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Dwarnings" + working-directory: hmac diff --git a/.github/workflows/pmac.yml b/.github/workflows/pmac.yml new file mode 100644 index 0000000..6117110 --- /dev/null +++ b/.github/workflows/pmac.yml @@ -0,0 +1,53 @@ +name: pmac + +on: + pull_request: + paths: + - "pmac/**" + - "Cargo.*" + push: + branches: master + paths: + - "pmac/**" + - "Cargo.*" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - thumbv7em-none-eabi + - wasm32-unknown-unknown + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: cargo build --no-default-features --release --target ${{ matrix.target }} + working-directory: pmac + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - run: cargo test --release + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Dwarnings" + working-directory: pmac diff --git a/.gitignore b/.gitignore index 9de1de0..2f7896d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ target/ -*/target/ -*/*/target/ -Cargo.lock diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 30c7001..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: rust -services: docker -sudo: required - -matrix: - include: - - env: NAME="hmac MSRV" - rust: 1.21.0 - script: cd hmac && cargo test --verbose - - rust: 1.27.0 - script: cargo test --verbose --all - - rust: stable - script: cargo test --verbose --all - - rust: nightly - script: cargo test --verbose --all - - - env: TARGET=i686-unknown-linux-gnu - rust: stable - - env: TARGET=powerpc-unknown-linux-gnu - rust: stable - - env: TARGET=powerpc64-unknown-linux-gnu - rust: stable - - # tests if crates truly can be built without std - - env: TARGET=thumbv7em-none-eabi - rust: stable - install: rustup target install $TARGET - script: - - cargo build --verbose --all --tests - -install: - - cargo install cross || true - -script: - - cross test --verbose --all --target $TARGET - -cache: cargo diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e44176a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,218 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aes" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" +dependencies = [ + "aes-soft", + "aesni", + "block-cipher-trait", +] + +[[package]] +name = "aes-soft" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" +dependencies = [ + "block-cipher-trait", + "byteorder", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" +dependencies = [ + "block-cipher-trait", + "opaque-debug", +] + +[[package]] +name = "blobby" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe5f8c2940b65859ece4b3b2ba02d2b12c87cab455fd42dee2556a187bb2cf6" +dependencies = [ + "byteorder", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-cipher-trait" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "cmac" +version = "0.2.0" +dependencies = [ + "aes", + "block-cipher-trait", + "crypto-mac", + "dbl", +] + +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +dependencies = [ + "blobby", + "generic-array", + "subtle", +] + +[[package]] +name = "daa" +version = "0.1.0" +dependencies = [ + "crypto-mac", + "des", +] + +[[package]] +name = "dbl" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dc203b75decc900220c4d9838e738d08413e663c26826ba92b669bed1d0795" +dependencies = [ + "generic-array", +] + +[[package]] +name = "des" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fca0626eef3fdddbad21650dba1dda86c244ee7d5e650aba0bd3f002a7208c" +dependencies = [ + "block-cipher-trait", + "byteorder", + "opaque-debug", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "hmac" +version = "0.7.1" +dependencies = [ + "crypto-mac", + "digest", + "md-5", + "sha2", +] + +[[package]] +name = "md-5" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18af3dcaf2b0219366cdb4e2af65a6101457b415c3d1a5c71dd9c2b7c77b9c8" +dependencies = [ + "block-buffer", + "digest", + "opaque-debug", +] + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "pmac" +version = "0.2.0" +dependencies = [ + "aes", + "block-cipher-trait", + "crypto-mac", + "dbl", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" diff --git a/cmac/Cargo.toml b/cmac/Cargo.toml index 300bc50..66d4cf8 100644 --- a/cmac/Cargo.toml +++ b/cmac/Cargo.toml @@ -17,6 +17,3 @@ dbl = "0.2" [dev-dependencies] crypto-mac = { version = "0.7", features = ["dev"] } aes = "0.3" - -[badges] -travis-ci = { repository = "RustCrypto/hashes" } diff --git a/cmac/src/lib.rs b/cmac/src/lib.rs index d064ba7..290ab71 100644 --- a/cmac/src/lib.rs +++ b/cmac/src/lib.rs @@ -163,7 +163,7 @@ where } #[inline] - fn result(mut self) -> MacResult { + fn result(self) -> MacResult { let n = C::BlockSize::to_usize(); let mut buf = self.buffer.clone(); if self.pos == n { diff --git a/hmac/Cargo.toml b/hmac/Cargo.toml index 2ffd5ef..d18686b 100644 --- a/hmac/Cargo.toml +++ b/hmac/Cargo.toml @@ -17,6 +17,3 @@ digest = "0.8" crypto-mac = { version = "0.7", features = ["dev"] } md-5 = { version = "0.8", default-features = false } sha2 = { version = "0.8", default-features = false } - -[badges] -travis-ci = { repository = "RustCrypto/hashes" } diff --git a/pmac/Cargo.toml b/pmac/Cargo.toml index 020acb9..df78e54 100644 --- a/pmac/Cargo.toml +++ b/pmac/Cargo.toml @@ -17,6 +17,3 @@ dbl = "0.2" [dev-dependencies] crypto-mac = { version = "0.7", features = ["dev"] } aes = "0.3" - -[badges] -travis-ci = { repository = "RustCrypto/hashes" }