diff --git a/.github/workflows/curve25519-dalek-rust.yml b/.github/workflows/curve25519-dalek-rust.yml new file mode 100644 index 000000000..d8c1ff006 --- /dev/null +++ b/.github/workflows/curve25519-dalek-rust.yml @@ -0,0 +1,134 @@ +name: curve25519-dalek Rust + +on: + push: + branches: [ '**' ] + paths: 'curve25519-dalek/**' + pull_request: + branches: [ '**' ] + paths: 'curve25519-dalek/**' + +defaults: + run: + working-directory: curve25519-dalek + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: '-D warnings' + +jobs: + + test-fiat: + name: curve25519 - Test fiat backend + runs-on: ubuntu-latest + strategy: + matrix: + include: + # 32-bit target + - target: i686-unknown-linux-gnu + deps: sudo apt update && sudo apt install gcc-multilib + + # 64-bit target + - target: x86_64-unknown-linux-gnu + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: rustup target add ${{ matrix.target }} + - run: ${{ matrix.deps }} + - env: + RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"' + run: cargo test --target ${{ matrix.target }} + + test-serial: + name: curve25519 - Test serial backend + runs-on: ubuntu-latest + strategy: + matrix: + include: + # 32-bit target + - target: i686-unknown-linux-gnu + deps: sudo apt update && sudo apt install gcc-multilib + + # 64-bit target + - target: x86_64-unknown-linux-gnu + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: rustup target add ${{ matrix.target }} + - run: ${{ matrix.deps }} + - env: + RUSTFLAGS: '--cfg curve25519_dalek_backend="serial"' + run: cargo test --target ${{ matrix.target }} + + build-script: + name: curve25519 - Test Build Script + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + targets: wasm32-unknown-unknown,x86_64-unknown-linux-gnu,i686-unknown-linux-gnu + - run: bash tests/build_tests.sh + + test-simd-nightly: + name: curve25519 - Test simd backend (nightly) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - env: + # This will: + # 1) build all of the x86_64 SIMD code, + # 2) run all of the SIMD-specific tests that the test runner supports, + # 3) run all of the normal tests using the best available SIMD backend. + # This should automatically pick up the simd backend in a x84_64 runner + RUSTFLAGS: '-C target_cpu=native' + run: cargo test --target x86_64-unknown-linux-gnu + + test-simd-stable: + name: curve25519 - Test simd backend (stable) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - env: + # This will run AVX2-specific tests and run all of the normal tests + # with the AVX2 backend, even if the runner supports AVX512. + # This should automatically pick up the simd backend in a x86_64 runner + # It should pick AVX2 due to stable toolchain used since AVX512 requires nigthly + RUSTFLAGS: '-C target_feature=+avx2' + run: cargo test --no-default-features --features alloc,precomputed-tables,zeroize --target x86_64-unknown-linux-gnu + + msrv: + name: curve25519 - Current MSRV is 1.60.0 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # First run `cargo +nightly -Z minimal-verisons check` in order to get a + # Cargo.lock with the oldest possible deps + - uses: dtolnay/rust-toolchain@nightly + - run: cargo -Z minimal-versions check --no-default-features --features serde + # Now check that `cargo build` works with respect to the oldest possible + # deps and the stated MSRV + - uses: dtolnay/rust-toolchain@1.60.0 + - run: cargo build --no-default-features --features serde + # Also make sure the AVX2 build works + - run: cargo build --target x86_64-unknown-linux-gnu + + bench: + name: curve25519 - Check that benchmarks compile + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - name: Build u32 bench + env: + RUSTFLAGS: '--cfg curve25519_dalek_bits="32"' + run: cargo build --benches + - name: Build u64 bench + env: + RUSTFLAGS: '--cfg curve25519_dalek_bits="64"' + run: cargo build --benches + - name: Build default (host native) bench + run: cargo build --benches diff --git a/.github/workflows/ed25519-dalek-rust.yml b/.github/workflows/ed25519-dalek-rust.yml index a70fef0e5..e859aa5fc 100644 --- a/.github/workflows/ed25519-dalek-rust.yml +++ b/.github/workflows/ed25519-dalek-rust.yml @@ -3,8 +3,14 @@ name: Rust on: push: branches: [ '**' ] + paths: 'ed25519-dalek/**' pull_request: branches: [ '**' ] + paths: 'ed25519-dalek/**' + +defaults: + run: + working-directory: x25519-dalek env: CARGO_TERM_COLOR: always @@ -12,50 +18,9 @@ env: RUSTDOCFLAGS: '-D warnings' jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - include: - # 32-bit target - - target: i686-unknown-linux-gnu - deps: sudo apt update && sudo apt install gcc-multilib - # 64-bit target - - target: x86_64-unknown-linux-gnu - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - run: rustup target add ${{ matrix.target }} - - run: ${{ matrix.deps }} - - run: cargo test --target ${{ matrix.target }} --no-default-features --lib --tests - - run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc --lib - - run: cargo test --target ${{ matrix.target }} --no-default-features --features fast --lib - - run: cargo test --target ${{ matrix.target }} --no-default-features --features rand_core --lib --tests - - run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc,rand_core --lib --tests - - run: cargo test --target ${{ matrix.target }} --no-default-features --features fast,rand_core --lib --tests - - run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc,fast,rand_core --lib --tests - - run: cargo test --target ${{ matrix.target }} - - run: cargo test --target ${{ matrix.target }} --features batch - - run: cargo test --target ${{ matrix.target }} --features digest,rand_core - - run: cargo test --target ${{ matrix.target }} --features serde - - run: cargo test --target ${{ matrix.target }} --features pem - - run: cargo test --target ${{ matrix.target }} --all-features - - build-simd: - name: Test simd backend (nightly) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - - env: - RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2' - run: cargo build --target x86_64-unknown-linux-gnu - - env: - RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma' - run: cargo build --target x86_64-unknown-linux-gnu msrv: - name: Current MSRV is 1.60.0 + name: ed25519 - Current MSRV is 1.60.0 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -70,53 +35,10 @@ jobs: - uses: dtolnay/rust-toolchain@1.60.0 - run: cargo build - build-nostd: - name: Build on no_std target (thumbv7em-none-eabi) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - targets: thumbv7em-none-eabi - - uses: taiki-e/install-action@cargo-hack - # No default features build - - run: cargo build --target thumbv7em-none-eabi --release --no-default-features - - run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std - bench: - name: Check that benchmarks compile + name: ed25519 - Check that benchmarks compile runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - run: cargo build --benches --features batch - - rustfmt: - name: Check formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - run: cargo fmt --all -- --check - - clippy: - name: Check that clippy is happy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.65 - with: - components: clippy - - run: cargo clippy - - doc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - run: cargo doc --all-features diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 77d38581c..5f791c9f9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Rust +name: All: Rust on: push: @@ -11,7 +11,8 @@ env: RUSTFLAGS: '-D warnings' jobs: - test-auto: + test-stable: + name: All - Test 32/64 bit stable runs-on: ubuntu-latest strategy: matrix: @@ -28,70 +29,11 @@ jobs: - run: rustup target add ${{ matrix.target }} - run: ${{ matrix.deps }} - run: cargo test --target ${{ matrix.target }} --no-default-features - - run: cargo test --target ${{ matrix.target }} --no-default-features --features alloc - - run: cargo test --target ${{ matrix.target }} --no-default-features --features digest - - run: cargo test --target ${{ matrix.target }} --no-default-features --features precomputed-tables - - run: cargo test --target ${{ matrix.target }} --no-default-features --features rand_core - - run: cargo test --target ${{ matrix.target }} --no-default-features --features serde - - run: cargo test --target ${{ matrix.target }} --no-default-features --features zeroize - run: cargo test --target ${{ matrix.target }} - - run: cargo test --target ${{ matrix.target }} --features digest - - run: cargo test --target ${{ matrix.target }} --features rand_core - - run: cargo test --target ${{ matrix.target }} --features serde - - test-fiat: - runs-on: ubuntu-latest - strategy: - matrix: - include: - # 32-bit target - - target: i686-unknown-linux-gnu - deps: sudo apt update && sudo apt install gcc-multilib - - # 64-bit target - - target: x86_64-unknown-linux-gnu - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - run: rustup target add ${{ matrix.target }} - - run: ${{ matrix.deps }} - - env: - RUSTFLAGS: '--cfg curve25519_dalek_backend="fiat"' - run: cargo test --target ${{ matrix.target }} - - test-serial: - runs-on: ubuntu-latest - strategy: - matrix: - include: - # 32-bit target - - target: i686-unknown-linux-gnu - deps: sudo apt update && sudo apt install gcc-multilib - - # 64-bit target - - target: x86_64-unknown-linux-gnu - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - run: rustup target add ${{ matrix.target }} - - run: ${{ matrix.deps }} - - env: - RUSTFLAGS: '--cfg curve25519_dalek_backend="serial"' - run: cargo test --target ${{ matrix.target }} - - build-script: - name: Test Build Script - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - targets: wasm32-unknown-unknown,x86_64-unknown-linux-gnu,i686-unknown-linux-gnu - - run: bash tests/build_tests.sh + - run: cargo test --target ${{ matrix.target }} --all-features build-nostd: - name: Build on no_std target (thumbv7em-none-eabi) + name: All - Build on no_std target (thumbv7em-none-eabi) runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -99,49 +41,13 @@ jobs: with: toolchain: stable targets: thumbv7em-none-eabi + - uses: taiki-e/install-action@cargo-hack + # No default features build - run: cargo build --target thumbv7em-none-eabi --release --no-default-features - - run: cargo build --target thumbv7em-none-eabi --release - - run: cargo build --target thumbv7em-none-eabi --release --features serde - - test-simd-nightly: - name: Test simd backend (nightly) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - - env: - # This will: - # 1) build all of the x86_64 SIMD code, - # 2) run all of the SIMD-specific tests that the test runner supports, - # 3) run all of the normal tests using the best available SIMD backend. - # This should automatically pick up the simd backend in a x84_64 runner - RUSTFLAGS: '-C target_cpu=native' - run: cargo test --target x86_64-unknown-linux-gnu - - test-simd-stable: - name: Test simd backend (stable) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - env: - # This will run AVX2-specific tests and run all of the normal tests - # with the AVX2 backend, even if the runner supports AVX512. - # This should automatically pick up the simd backend in a x86_64 runner - # It should pick AVX2 due to stable toolchain used since AVX512 requires nigthly - RUSTFLAGS: '-C target_feature=+avx2' - run: cargo test --no-default-features --features alloc,precomputed-tables,zeroize --target x86_64-unknown-linux-gnu + - run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std - build-docs: - name: Build docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - - run: make doc - - run: make doc-internal - - cross: + test-cross: + name: All - cross Test strategy: matrix: include: @@ -168,8 +74,8 @@ jobs: - uses: RustCrypto/actions/cross-install@master - run: cross test --release --target ${{ matrix.target }} - nightly: - name: Test nightly compiler + test-nightly: + name: All - nightly Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -177,7 +83,7 @@ jobs: - run: cargo test clippy: - name: Check that clippy is happy + name: All - Check that clippy is happy runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -187,7 +93,7 @@ jobs: - run: cargo clippy --target x86_64-unknown-linux-gnu rustfmt: - name: Check formatting + name: All - Check formatting runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -196,35 +102,12 @@ jobs: components: rustfmt - run: cargo fmt --all -- --check - msrv: - name: Current MSRV is 1.60.0 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # First run `cargo +nightly -Z minimal-verisons check` in order to get a - # Cargo.lock with the oldest possible deps - - uses: dtolnay/rust-toolchain@nightly - - run: cargo -Z minimal-versions check --no-default-features --features serde - # Now check that `cargo build` works with respect to the oldest possible - # deps and the stated MSRV - - uses: dtolnay/rust-toolchain@1.60.0 - - run: cargo build --no-default-features --features serde - # Also make sure the AVX2 build works - - run: cargo build --target x86_64-unknown-linux-gnu - - bench: - name: Check that benchmarks compile + doc: + name: All - Make Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - name: Build u32 bench - env: - RUSTFLAGS: '--cfg curve25519_dalek_bits="32"' - run: cargo build --benches - - name: Build u64 bench - env: - RUSTFLAGS: '--cfg curve25519_dalek_bits="64"' - run: cargo build --benches - - name: Build default (host native) bench - run: cargo build --benches + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - run: cargo doc --all-features diff --git a/.github/workflows/x25519-dalek-rust.yml b/.github/workflows/x25519-dalek-rust.yml index c36717335..dbc5a3e37 100644 --- a/.github/workflows/x25519-dalek-rust.yml +++ b/.github/workflows/x25519-dalek-rust.yml @@ -3,8 +3,14 @@ name: Rust on: push: branches: [ '**' ] + paths: 'x25519-dalek/**' pull_request: branches: [ '**' ] + paths: 'x25519-dalek/**' + +defaults: + run: + working-directory: x25519-dalek env: CARGO_TERM_COLOR: always @@ -12,44 +18,9 @@ env: RUSTDOCFLAGS: '-D warnings' jobs: - test: - name: Test with multiple feature combinations - runs-on: ubuntu-latest - strategy: - matrix: - include: - # 32-bit target - - target: i686-unknown-linux-gnu - deps: sudo apt update && sudo apt install gcc-multilib - # 64-bit target - - target: x86_64-unknown-linux-gnu - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - target: ${{ matrix.target }} - - run: ${{ matrix.deps }} - - run: cargo test --target ${{ matrix.target }} --no-default-features - - run: cargo test --target ${{ matrix.target }} --no-default-features --features reusable_secrets - - run: cargo test --target ${{ matrix.target }} --no-default-features --features static_secrets - - run: cargo test --target ${{ matrix.target }} - - run: cargo test --target ${{ matrix.target }} --all-features - - build-simd: - name: Test simd backend (nightly) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - - env: - RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2' - run: cargo build --target x86_64-unknown-linux-gnu - - env: - RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma' - run: cargo build --target x86_64-unknown-linux-gnu msrv: - name: Current MSRV is 1.60.0 + name: x25519 Current MSRV is 1.60.0 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -64,69 +35,10 @@ jobs: - uses: dtolnay/rust-toolchain@1.60.0 - run: cargo build -# no_std support is pending feature, tracking: -# https://github.com/dalek-cryptography/x25519-dalek/issues/111 -# # Test no_std integration with no features -# build-nostd-base: -# name: Build on no_std target (thumbv7em-none-eabi) -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@master -# with: -# toolchain: stable -# targets: thumbv7em-none-eabi -# - uses: taiki-e/install-action@cargo-hack -# # No default features build -# - run: cargo build --target thumbv7em-none-eabi --release --no-default-features -# -# # Test no_std integration with all no_std features -# build-nostd-features: -# name: Build on no_std target (thumbv7em-none-eabi) -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: dtolnay/rust-toolchain@master -# with: -# toolchain: stable -# targets: thumbv7em-none-eabi -# - uses: taiki-e/install-action@cargo-hack -# # No default features build -# - run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std - bench: - name: Check that benchmarks compile + name: x25519 Check that benchmarks compile runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - run: cargo build --benches - - rustfmt: - name: Check formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - run: cargo fmt --all -- --check - - clippy: - name: Check that clippy is happy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@1.65 - with: - components: clippy - - run: cargo clippy - - doc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - run: cargo doc --all-features