From d953b4c4c846ee8aed4c4412cc49686e7d5958b3 Mon Sep 17 00:00:00 2001 From: Akhil Velagapudi Date: Tue, 29 Oct 2019 22:18:17 -0700 Subject: [PATCH 01/13] initial workspace workflow shared by all crates --- .github/workflows/workspace.yml | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/workspace.yml diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml new file mode 100644 index 000000000..cf254e50e --- /dev/null +++ b/.github/workflows/workspace.yml @@ -0,0 +1,45 @@ +name: workspace +on: +- push +- pull_request +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - 1.36.0 # workspace MSRV + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + - run: | + cargo check --all-features + cargo test --no-default-features + cargo test + cargo test --all-features + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: clippy + - run: cargo clippy --all-features -- -D warnings + no_std: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: thumbv7em-none-eabi + - run: cargo build --target thumbv7em-none-eabi From 13aa64b3061eb2201ec69c39cda5bd96ce4cee42 Mon Sep 17 00:00:00 2001 From: Akhil Velagapudi Date: Tue, 29 Oct 2019 22:19:01 -0700 Subject: [PATCH 02/13] crate specific workflows for older MSRVs and custom feature sets --- .github/workflows/block-cipher-trait.yml | 27 ++++++++++++++++++++++++ .github/workflows/crypto-mac.yml | 27 ++++++++++++++++++++++++ .github/workflows/digest.yml | 27 ++++++++++++++++++++++++ .github/workflows/stream-cipher.yml | 27 ++++++++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 .github/workflows/block-cipher-trait.yml create mode 100644 .github/workflows/crypto-mac.yml create mode 100644 .github/workflows/digest.yml create mode 100644 .github/workflows/stream-cipher.yml diff --git a/.github/workflows/block-cipher-trait.yml b/.github/workflows/block-cipher-trait.yml new file mode 100644 index 000000000..886c64d50 --- /dev/null +++ b/.github/workflows/block-cipher-trait.yml @@ -0,0 +1,27 @@ +name: block-cipher-trait +on: + push: + paths: + - 'block-cipher-trait/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - 1.21.0 # MSRV + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + - run: | + cargo check --all-features + cargo test --features dev + cargo test --features std + cargo test --all-features + working-directory: block-cipher-trait diff --git a/.github/workflows/crypto-mac.yml b/.github/workflows/crypto-mac.yml new file mode 100644 index 000000000..5a0e82b9d --- /dev/null +++ b/.github/workflows/crypto-mac.yml @@ -0,0 +1,27 @@ +name: crypto-mac +on: + push: + paths: + - 'crypto-mac/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - 1.21.0 # MSRV + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + - run: | + cargo check --all-features + cargo test --features dev + cargo test --features std + cargo test --all-features + working-directory: crypto-mac diff --git a/.github/workflows/digest.yml b/.github/workflows/digest.yml new file mode 100644 index 000000000..706487c8a --- /dev/null +++ b/.github/workflows/digest.yml @@ -0,0 +1,27 @@ +name: digest +on: + push: + paths: + - 'digest/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - 1.21.0 # MSRV + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + - run: | + cargo check --all-features + cargo test --features dev + cargo test --features std + cargo test --all-features + working-directory: digest diff --git a/.github/workflows/stream-cipher.yml b/.github/workflows/stream-cipher.yml new file mode 100644 index 000000000..9e3a22d14 --- /dev/null +++ b/.github/workflows/stream-cipher.yml @@ -0,0 +1,27 @@ +name: stream-cipher +on: + push: + paths: + - 'stream-cipher/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - 1.21.0 # MSRV + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + - run: | + cargo check --all-features + cargo test --features dev + cargo test --features std + cargo test --all-features + working-directory: stream-cipher From 7311b1b7c50e084526e03d6905298d11d694d0d0 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:22:33 -0700 Subject: [PATCH 03/13] Remove .travis.yml No longer needed after migrating to GitHub Actions --- .travis.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 554aa4ef8..000000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: rust -services: docker -sudo: required - -matrix: - include: - - rust: 1.41.0 - script: cargo test --verbose --all --exclude aead --exclude signature --exclude universal-hash --release - - rust: 1.43.0 - script: cargo test --verbose --package aead --package signature --package universal-hash --release - - rust: stable - script: cargo test --verbose --all --release - - rust: nightly - script: cargo test --verbose --all --release - # tests if crates can be built with std feature - - rust: 1.41.0 - script: ./build_std.sh - - - 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: nightly - script: xargo build --all --exclude aead --exclude signature --verbose --target $TARGET - install: - - cargo install xargo || true - - rustup target install armv7-unknown-linux-gnueabihf - - rustup component add rust-src - -install: - - cargo install cross || true - -script: - - cross test --verbose --all --exclude signature_derive --release --target $TARGET - -cache: cargo From 34fade19638f50f9879042855ea92f9232d790aa Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:27:52 -0700 Subject: [PATCH 04/13] .github: only build on Rust 1.41 + stable This bumps the MSRV to 1.41 to match the current state of the repo and removes the `beta` and `nightly` builds as these create a much larger combinatorial explosion of builds. --- .github/workflows/block-cipher-trait.yml | 4 +--- .github/workflows/crypto-mac.yml | 4 +--- .github/workflows/digest.yml | 4 +--- .github/workflows/stream-cipher.yml | 4 +--- .github/workflows/workspace.yml | 4 +--- README.md | 1 + 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/block-cipher-trait.yml b/.github/workflows/block-cipher-trait.yml index 886c64d50..cbce21c8e 100644 --- a/.github/workflows/block-cipher-trait.yml +++ b/.github/workflows/block-cipher-trait.yml @@ -9,10 +9,8 @@ jobs: strategy: matrix: rust: + - 1.41.0 # MSRV - stable - - beta - - nightly - - 1.21.0 # MSRV steps: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/crypto-mac.yml b/.github/workflows/crypto-mac.yml index 5a0e82b9d..bcaf1894e 100644 --- a/.github/workflows/crypto-mac.yml +++ b/.github/workflows/crypto-mac.yml @@ -9,10 +9,8 @@ jobs: strategy: matrix: rust: + - 1.41.0 # MSRV - stable - - beta - - nightly - - 1.21.0 # MSRV steps: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/digest.yml b/.github/workflows/digest.yml index 706487c8a..f09ae10bd 100644 --- a/.github/workflows/digest.yml +++ b/.github/workflows/digest.yml @@ -9,10 +9,8 @@ jobs: strategy: matrix: rust: + - 1.41.0 # MSRV - stable - - beta - - nightly - - 1.21.0 # MSRV steps: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/stream-cipher.yml b/.github/workflows/stream-cipher.yml index 9e3a22d14..1ae442d7c 100644 --- a/.github/workflows/stream-cipher.yml +++ b/.github/workflows/stream-cipher.yml @@ -9,10 +9,8 @@ jobs: strategy: matrix: rust: + - 1.41.0 # MSRV - stable - - beta - - nightly - - 1.21.0 # MSRV steps: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index cf254e50e..b47128900 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -8,10 +8,8 @@ jobs: strategy: matrix: rust: + - 1.41.0 # MSRV - stable - - beta - - nightly - - 1.36.0 # workspace MSRV steps: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 diff --git a/README.md b/README.md index 70cbffd63..e830d9f64 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Collection of traits which describe functionality of cryptographic primitives. | [`universal-hash`](https://en.wikipedia.org/wiki/Universal_hashing) | [![crates.io](https://img.shields.io/crates/v/universal-hash.svg)](https://crates.io/crates/universal-hash) | [![Documentation](https://docs.rs/universal-hash/badge.svg)](https://docs.rs/universal-hash) | ### Minimum Rust version + All crates in this repository support Rust 1.41 or higher unless otherwise noted. In future minimally supported version of Rust can be changed, but it will be done From 6992f367ebae0fb31ef11d90b2f78a8d7f8de1a0 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:32:07 -0700 Subject: [PATCH 05/13] .github: build pull requests Builds all crates when pull requests are opened as well as pushes to master. --- .github/workflows/block-cipher-trait.yml | 10 +++++++++- .github/workflows/crypto-mac.yml | 10 +++++++++- .github/workflows/digest.yml | 10 +++++++++- .github/workflows/stream-cipher.yml | 10 +++++++++- .github/workflows/workspace.yml | 13 ++++++++++--- 5 files changed, 46 insertions(+), 7 deletions(-) diff --git a/.github/workflows/block-cipher-trait.yml b/.github/workflows/block-cipher-trait.yml index cbce21c8e..a7b28ae08 100644 --- a/.github/workflows/block-cipher-trait.yml +++ b/.github/workflows/block-cipher-trait.yml @@ -1,8 +1,16 @@ name: block-cipher-trait + on: + pull_request: + paths: + - "block-cipher-trait/**" + - "Cargo.*" push: + branches: master paths: - - 'block-cipher-trait/**' + - "block-cipher-trait/**" + - "Cargo.*" + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/crypto-mac.yml b/.github/workflows/crypto-mac.yml index bcaf1894e..6271a1c46 100644 --- a/.github/workflows/crypto-mac.yml +++ b/.github/workflows/crypto-mac.yml @@ -1,8 +1,16 @@ name: crypto-mac + on: + pull_request: + paths: + - "crypto-mac/**" + - "Cargo.*" push: + branches: master paths: - - 'crypto-mac/**' + - "crypto-mac/**" + - "Cargo.*" + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/digest.yml b/.github/workflows/digest.yml index f09ae10bd..400b0211e 100644 --- a/.github/workflows/digest.yml +++ b/.github/workflows/digest.yml @@ -1,8 +1,16 @@ name: digest + on: + pull_request: + paths: + - "digest/**" + - "Cargo.*" push: + branches: master paths: - - 'digest/**' + - "digest/**" + - "Cargo.*" + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/stream-cipher.yml b/.github/workflows/stream-cipher.yml index 1ae442d7c..1ff1141ad 100644 --- a/.github/workflows/stream-cipher.yml +++ b/.github/workflows/stream-cipher.yml @@ -1,8 +1,16 @@ name: stream-cipher + on: + pull_request: + paths: + - "stream-cipher/**" + - "Cargo.*" push: + branches: master paths: - - 'stream-cipher/**' + - "stream-cipher/**" + - "Cargo.*" + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index b47128900..a29f0dc94 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -1,7 +1,14 @@ -name: workspace +name: Workspace + on: -- push -- pull_request + pull_request: + paths-ignore: + - README.md + push: + branches: master + paths-ignore: + - README.md + jobs: test: runs-on: ubuntu-latest From 16d802c5367f2282492e57ef68c64a354a20ec11 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:44:34 -0700 Subject: [PATCH 06/13] .github: remove no_std build configuration This needs to be split apart by crate since we need to pass `--no-default-features` and that's not available at a workspace level. This can get added back once the initial build is working. --- .github/workflows/workspace.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index a29f0dc94..64ac7b59c 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -38,13 +38,3 @@ jobs: toolchain: stable components: clippy - run: cargo clippy --all-features -- -D warnings - no_std: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - target: thumbv7em-none-eabi - - run: cargo build --target thumbv7em-none-eabi From 3c547a73045e950507450203c09e246db3794e03 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:45:42 -0700 Subject: [PATCH 07/13] Cargo.lock: check into repository This is useful for gating GitHub Actions' caching --- .gitignore | 4 - Cargo.lock | 301 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 301 insertions(+), 4 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index a4048e8bb..2f7896d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ target/ -*/target/ -*/*/target/ -Cargo.lock - diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..42f6afa6b --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,301 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aead" +version = "0.2.0" +dependencies = [ + "generic-array 0.14.1", + "heapless", +] + +[[package]] +name = "as-slice" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37dfb65bc03b2bc85ee827004f14a6817e04160e3b1a28931986a666a9290e70" +dependencies = [ + "generic-array 0.12.3", + "generic-array 0.13.2", + "stable_deref_trait", +] + +[[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 0.12.3", +] + +[[package]] +name = "block-cipher-trait" +version = "0.6.2" +dependencies = [ + "blobby", + "generic-array 0.14.1", +] + +[[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 = "crypto-mac" +version = "0.8.0" +dependencies = [ + "blobby", + "generic-array 0.13.2", + "subtle", +] + +[[package]] +name = "digest" +version = "0.8.1" +dependencies = [ + "blobby", + "generic-array 0.14.1", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.3", +] + +[[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 = "generic-array" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed1e761351b56f54eb9dcd0cfaca9fd0daecf93918e1cfc01c8a3d26ee7adcd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2664c2cf08049036f31015b04c6ac3671379a1d86f52ed2416893f16022deb" +dependencies = [ + "typenum", +] + +[[package]] +name = "hash32" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4041af86e63ac4298ce40e5cca669066e75b6f1aa3390fe2561ffa5e1d9f4cc" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a8a2391a3bc70b31f60e7a90daa5755a360559c0b6b9c5cfc0fee482362dc0" +dependencies = [ + "as-slice", + "generic-array 0.13.2", + "hash32", + "stable_deref_trait", +] + +[[package]] +name = "hex-literal" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" +dependencies = [ + "hex-literal-impl", + "proc-macro-hack", +] + +[[package]] +name = "hex-literal-impl" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4c5c844e2fee0bf673d54c2c177f1713b3d2af2ff6e666b49cb7572e6cf42d" +dependencies = [ + "proc-macro-hack", +] + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "proc-macro-hack" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" + +[[package]] +name = "proc-macro2" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + +[[package]] +name = "sha2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +dependencies = [ + "block-buffer", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "signature" +version = "1.0.1" +dependencies = [ + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal", + "rand_core", + "sha2", + "signature_derive", +] + +[[package]] +name = "signature_derive" +version = "1.0.0-pre.2" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" + +[[package]] +name = "stream-cipher" +version = "0.3.2" +dependencies = [ + "blobby", + "generic-array 0.14.1", +] + +[[package]] +name = "subtle" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" + +[[package]] +name = "syn" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e5aa70697bb26ee62214ae3288465ecec0000f05182f039b477001f08f5ae7" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "universal-hash" +version = "0.3.0" +dependencies = [ + "generic-array 0.14.1", + "subtle", +] From 94e3729a78c33c3297b29f4909ca6d73b74b6478 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:49:48 -0700 Subject: [PATCH 08/13] .github: add workflow for `signature` crate --- .github/workflows/signature.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/signature.yml diff --git a/.github/workflows/signature.yml b/.github/workflows/signature.yml new file mode 100644 index 000000000..aa033f16e --- /dev/null +++ b/.github/workflows/signature.yml @@ -0,0 +1,33 @@ +name: signature + +on: + pull_request: + paths: + - "signature/**" + - "Cargo.*" + push: + branches: master + paths: + - "signature/**" + - "Cargo.*" + +jobs: + 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 }} + - run: | + cargo check --all-features + cargo test --features dev + cargo test --features std + cargo test --all-features + working-directory: signature From 026318b39deb7b1c65ce52d3f409064ecd42d826 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:54:35 -0700 Subject: [PATCH 09/13] universal-hash: fix cargo check failures + std::error::Error The `Display` impl on the error type was using the deprecated `description()` method. This was removed. With that removed, the `Display` impl can still exist in a `no_std` environment. Reduces the `std::error::Error` impl to just a marker trait. --- universal-hash/src/lib.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/universal-hash/src/lib.rs b/universal-hash/src/lib.rs index b0981f155..264bdd9ab 100644 --- a/universal-hash/src/lib.rs +++ b/universal-hash/src/lib.rs @@ -156,17 +156,11 @@ impl> Eq for Output {} #[derive(Default, Debug, Copy, Clone, Eq, PartialEq)] pub struct Error; -#[cfg(feature = "std")] -impl std::error::Error for Error { - fn description(&self) -> &'static str { - "UHF output mismatch" +impl core::fmt::Display for Error { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.write_str("UHF output mismatch") } } #[cfg(feature = "std")] -impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - use std::error::Error; - self.description().fmt(f) - } -} +impl std::error::Error for Error {} From 9e9b814f27bcd0e7ef9e5577d4c3eff920e24518 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 11:55:46 -0700 Subject: [PATCH 10/13] digest: fix `cargo check` warnings Missing the `dyn` keyword on `DynDigest` --- digest/src/dyn_digest.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/digest/src/dyn_digest.rs b/digest/src/dyn_digest.rs index cb144bdee..93dfdd08c 100644 --- a/digest/src/dyn_digest.rs +++ b/digest/src/dyn_digest.rs @@ -25,7 +25,7 @@ pub trait DynDigest { fn output_size(&self) -> usize; /// Clone hasher state into a boxed trait object - fn box_clone(&self) -> Box; + fn box_clone(&self) -> Box; } impl DynDigest for D { @@ -51,12 +51,12 @@ impl DynDigest for D { ::OutputSize::to_usize() } - fn box_clone(&self) -> Box { + fn box_clone(&self) -> Box { Box::new(self.clone()) } } -impl Clone for Box { +impl Clone for Box { fn clone(&self) -> Self { self.box_clone() } From d42712b3b41d4f7cc9893f5f2f49deced474218d Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 12:02:21 -0700 Subject: [PATCH 11/13] digest: fix clippy warnings --- .github/workflows/workspace.yml | 2 +- digest/src/dev.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 64ac7b59c..62865cf50 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -37,4 +37,4 @@ jobs: profile: minimal toolchain: stable components: clippy - - run: cargo clippy --all-features -- -D warnings + - run: cargo clippy --all --all-features -- -D warnings diff --git a/digest/src/dev.rs b/digest/src/dev.rs index f4d79e71e..71723a266 100644 --- a/digest/src/dev.rs +++ b/digest/src/dev.rs @@ -57,7 +57,7 @@ mod foo { while left > 0 { let take = (left + 1) / 2; hasher.input(&input[len - left..take + len - left]); - left = left - take; + left -= take; } if hasher.result().as_slice() != output { return Some("message in pieces"); @@ -129,7 +129,7 @@ where while left > 0 { let take = (left + 1) / 2; hasher.input(&input[len - left..take + len - left]); - left = left - take; + left -= take; } { @@ -186,7 +186,7 @@ where while left > 0 { let take = (left + 1) / 2; hasher.input(&input[len - left..take + len - left]); - left = left - take; + left -= take; } hasher.variable_result(|res| buf.copy_from_slice(res)); if buf != output { From e55a798b8ad9df7661ea3704090671df0c647434 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 12:03:39 -0700 Subject: [PATCH 12/13] .github: remove copypasta cargo features from `signature` It doesn't have a `dev` feature --- .github/workflows/signature.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/signature.yml b/.github/workflows/signature.yml index aa033f16e..f835bf94f 100644 --- a/.github/workflows/signature.yml +++ b/.github/workflows/signature.yml @@ -27,7 +27,6 @@ jobs: toolchain: ${{ matrix.rust }} - run: | cargo check --all-features - cargo test --features dev - cargo test --features std - cargo test --all-features + cargo test --no-default-features + cargo test working-directory: signature From 455b8cc4bdbadbedf6aaa39ed998641ec3baa564 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 10 May 2020 12:08:11 -0700 Subject: [PATCH 13/13] .github: remove workspace-level tests; add rustfmt Each crate is already tested individually, so we don't need to run tests at the workspace-level as well. However, it is good to know if rustfmt is passing! --- .github/workflows/workspace.yml | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 62865cf50..57a726c7d 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -10,24 +10,6 @@ on: - README.md jobs: - 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 }} - - run: | - cargo check --all-features - cargo test --no-default-features - cargo test - cargo test --all-features clippy: runs-on: ubuntu-latest steps: @@ -35,6 +17,24 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: 1.41.0 components: clippy - run: cargo clippy --all --all-features -- -D warnings + rustfmt: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check