diff --git a/.github/workflows/blake2.yml b/.github/workflows/blake2.yml index 3303e5a71..cafd60cce 100644 --- a/.github/workflows/blake2.yml +++ b/.github/workflows/blake2.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -70,7 +70,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2021-05-01 + toolchain: nightly override: true - run: cargo test --features simd - run: cargo test --features simd_opt @@ -81,7 +81,7 @@ jobs: strategy: matrix: rust: - - 1.51 # 1.41-1.50 `--features` can't be used inside virtual manifest + - 1.57.0 - stable target: - aarch64-unknown-linux-gnu diff --git a/.github/workflows/fsb.yml b/.github/workflows/fsb.yml index 145676ae1..3e3481674 100644 --- a/.github/workflows/fsb.yml +++ b/.github/workflows/fsb.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/gost94.yml b/.github/workflows/gost94.yml index fbac73a17..0878ee250 100644 --- a/.github/workflows/gost94.yml +++ b/.github/workflows/gost94.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -63,21 +63,3 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features - - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv-41: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.41.0 # MSRV - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: cargo test - - run: cargo test --no-default-features diff --git a/.github/workflows/groestl.yml b/.github/workflows/groestl.yml index 3fcf501bd..15fe10e27 100644 --- a/.github/workflows/groestl.yml +++ b/.github/workflows/groestl.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/k12.yml b/.github/workflows/k12.yml index aede85d36..2f83e5fb4 100644 --- a/.github/workflows/k12.yml +++ b/.github/workflows/k12.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: # - thumbv7em-none-eabi # TODO: no_std w/o liballoc @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/md2.yml b/.github/workflows/md2.yml index 48f29a12c..3f9a771cc 100644 --- a/.github/workflows/md2.yml +++ b/.github/workflows/md2.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -63,22 +63,3 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features - - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv-41: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.41.0 # MSRV - - stable - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/md4.yml b/.github/workflows/md4.yml index 19adf96d3..867e6d9f4 100644 --- a/.github/workflows/md4.yml +++ b/.github/workflows/md4.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -64,21 +64,3 @@ jobs: - run: cargo test - run: cargo test --all-features - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv-41: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.41.0 # MSRV - - stable - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/md5.yml b/.github/workflows/md5.yml index 681453d47..dd4b7b5fc 100644 --- a/.github/workflows/md5.yml +++ b/.github/workflows/md5.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -52,7 +52,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -66,20 +66,3 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --features asm - - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.57.0 # MSRV - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: cargo test --features oid diff --git a/.github/workflows/ripemd.yml b/.github/workflows/ripemd.yml index 7c1e74c30..a2878f506 100644 --- a/.github/workflows/ripemd.yml +++ b/.github/workflows/ripemd.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,8 +49,6 @@ jobs: strategy: matrix: rust: - # Crate supports MSRV 1.41 without `oid` feature. We test true MSRV - # in the `test-msrv` job. - 1.57.0 - stable steps: @@ -66,20 +64,3 @@ jobs: - run: cargo test - run: cargo test --all-features - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.57.0 # MSRV - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - run: cargo test --features oid - - run: cargo test --no-default-features diff --git a/.github/workflows/sha1.yml b/.github/workflows/sha1.yml index ca09fd895..bd6b91353 100644 --- a/.github/workflows/sha1.yml +++ b/.github/workflows/sha1.yml @@ -21,8 +21,6 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - # Crate supports MSRV 1.41 without `oid` feature. We test true MSRV - # in the `test-msrv` job. msrv: 1.57.0 # Builds for no_std platforms @@ -146,7 +144,7 @@ jobs: strategy: matrix: rust: - - 1.51.0 # 1.41-1.50 `--features` can't be used inside virtual manifest + - 1.57.0 - stable target: - aarch64-unknown-linux-gnu @@ -173,17 +171,3 @@ jobs: package: ${{ github.workflow }} target: ${{ matrix.target }} features: ${{ matrix.features }} - - # TODO: remove on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.41.0 - override: true - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/sha2.yml b/.github/workflows/sha2.yml index d0cbe99a3..f3bcbfd77 100644 --- a/.github/workflows/sha2.yml +++ b/.github/workflows/sha2.yml @@ -21,8 +21,6 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - # Crate supports MSRV 1.41 without `oid` feature. We test true MSRV - # in the `test-msrv` job. msrv: 1.57.0 # Builds for no_std platforms @@ -118,10 +116,8 @@ jobs: strategy: matrix: include: - # 64-bit Windows (GNU) - # TODO(tarcieri): try re-enabling this when we bump MSRV - #- target: x86_64-pc-windows-gnu - # toolchain: 1.41.0 # MSRV + - target: x86_64-pc-windows-gnu + rust: 1.57.0 # MSRV - target: x86_64-pc-windows-gnu rust: stable @@ -143,7 +139,7 @@ jobs: strategy: matrix: rust: - - 1.51.0 # 1.41-1.50 `--features` can't be used inside virtual manifest + - 1.57.0 - stable target: - aarch64-unknown-linux-gnu @@ -168,17 +164,3 @@ jobs: package: ${{ github.workflow }} target: ${{ matrix.target }} features: ${{ matrix.features }} - - # TODO: remove on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.41.0 - override: true - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/sha3.yml b/.github/workflows/sha3.yml index 94fd650ba..36246251c 100644 --- a/.github/workflows/sha3.yml +++ b/.github/workflows/sha3.yml @@ -21,8 +21,6 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - # Crate supports MSRV 1.41 without `oid` feature. We test true MSRV - # in the `test-msrv` job. msrv: 1.57.0 build: @@ -78,7 +76,7 @@ jobs: strategy: matrix: rust: - - 1.51.0 # 1.41-1.50 `--features` can't be used inside virtual manifest + - 1.57.0 - stable target: - aarch64-unknown-linux-gnu @@ -99,17 +97,3 @@ jobs: package: ${{ github.workflow }} target: ${{ matrix.target }} features: ${{ matrix.features }} - - # TODO: remove on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.41.0 - override: true - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/shabal.yml b/.github/workflows/shabal.yml index e9a059d68..9e412d384 100644 --- a/.github/workflows/shabal.yml +++ b/.github/workflows/shabal.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/sm3.yml b/.github/workflows/sm3.yml index 9ae65d354..49dfc218b 100644 --- a/.github/workflows/sm3.yml +++ b/.github/workflows/sm3.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/streebog.yml b/.github/workflows/streebog.yml index dfdb4c522..52abfdd8a 100644 --- a/.github/workflows/streebog.yml +++ b/.github/workflows/streebog.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - #- 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -63,17 +63,3 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features - - # `oid` feature bumps MSRV to 1.57, so we temporarily split this job. - test-msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: RustCrypto/actions/cargo-cache@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.41.0 - override: true - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/tiger.yml b/.github/workflows/tiger.yml index d4c302703..49d077f56 100644 --- a/.github/workflows/tiger.yml +++ b/.github/workflows/tiger.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -52,7 +52,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/whirlpool.yml b/.github/workflows/whirlpool.yml index 049094070..41ab6ef08 100644 --- a/.github/workflows/whirlpool.yml +++ b/.github/workflows/whirlpool.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -49,7 +49,7 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + - 1.57.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index d851c17b4..56d9eb367 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,27 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "belt-block" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a1be3fcfd5950762b6ac3f929b7ac65f31b35afee94e17f6fcadd58ee47abee" + +[[package]] +name = "belt-hash" +version = "0.2.0" +dependencies = [ + "belt-block", + "digest", + "hex-literal 0.3.4", +] + [[package]] name = "blake2" -version = "0.10.6" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] @@ -18,10 +33,11 @@ checksum = "847495c209977a90e8aad588b959d0ca9f5dc228096d29a6bd3defd53f35eaec" [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.11.0-pre" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "23b6a33d658e9ef24ba0c4566d3d023d7978ca2ea3efb65e4eacd4586695892b" dependencies = [ + "crypto-common", "generic-array", ] @@ -54,9 +70,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.2.0-pre" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "6faaa83e7700e0832cbbf84854d4c356270526907d9b14fab927fc7a9b5befb8" dependencies = [ "generic-array", "typenum", @@ -64,9 +80,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.11.0-pre" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "1f2e47350a84ef81587a050177f84af69defbf2bee70bdfb92b500dbbd247e97" dependencies = [ "blobby", "block-buffer", @@ -77,10 +93,10 @@ dependencies = [ [[package]] name = "fsb" -version = "0.1.3" +version = "0.2.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", "whirlpool", ] @@ -96,18 +112,18 @@ dependencies = [ [[package]] name = "gost94" -version = "0.10.4" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] name = "groestl" -version = "0.10.1" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] @@ -120,6 +136,12 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + [[package]] name = "hex-literal-impl" version = "0.2.3" @@ -131,10 +153,10 @@ dependencies = [ [[package]] name = "k12" -version = "0.2.1" +version = "0.3.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] @@ -154,27 +176,27 @@ checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "md-5" -version = "0.10.5" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", "md5-asm", ] [[package]] name = "md2" -version = "0.10.2" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] name = "md4" -version = "0.10.2" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] @@ -194,20 +216,20 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "ripemd" -version = "0.1.3" +version = "0.2.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] name = "sha1" -version = "0.10.5" +version = "0.11.0" dependencies = [ "cfg-if", "cpufeatures", "digest", - "hex-literal", + "hex-literal 0.2.2", "sha1-asm", ] @@ -222,12 +244,12 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.11.0" dependencies = [ "cfg-if", "cpufeatures", "digest", - "hex-literal", + "hex-literal 0.3.4", "sha2-asm", ] @@ -242,35 +264,35 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.6" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", "keccak", ] [[package]] name = "shabal" -version = "0.4.1" +version = "0.5.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] name = "sm3" -version = "0.4.1" +version = "0.5.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] name = "streebog" -version = "0.10.2" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] @@ -281,10 +303,10 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "tiger" -version = "0.2.1" +version = "0.3.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", ] [[package]] @@ -301,10 +323,10 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "whirlpool" -version = "0.10.4" +version = "0.11.0" dependencies = [ "digest", - "hex-literal", + "hex-literal 0.3.4", "whirlpool-asm", ] diff --git a/Cargo.toml b/Cargo.toml index beee3a843..947808030 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,7 @@ [workspace] -# This causes issues like https://github.com/RustCrypto/hashes/issues/396 -# Do not uncomment it until MSRV is bumped to 1.51 or higher. -# resolver = "2" +resolver = "2" members = [ + "belt-hash", "blake2", "fsb", "gost94", @@ -21,7 +20,6 @@ members = [ "tiger", "whirlpool", ] -exclude = ["belt-hash"] [profile.dev] opt-level = 2 diff --git a/README.md b/README.md index 5a255d21a..e8e0d97ca 100644 --- a/README.md +++ b/README.md @@ -14,23 +14,23 @@ Additionally all crates do not require the standard library (i.e. `no_std` capab | Algorithm | Crate | Crates.io | Documentation | MSRV | [Security] | |-----------|-------|:---------:|:-------------:|:----:|:----------:| | [BelT] hash | [`belt-hash`] | [![crates.io](https://img.shields.io/crates/v/belt-hash.svg)](https://crates.io/crates/belt-hash) | [![Documentation](https://docs.rs/belt-hash/badge.svg)](https://docs.rs/belt-hash) | ![MSRV 1.57][msrv-1.57] | :green_heart: | -| [BLAKE2] | [`blake2`] | [![crates.io](https://img.shields.io/crates/v/blake2.svg)](https://crates.io/crates/blake2) | [![Documentation](https://docs.rs/blake2/badge.svg)](https://docs.rs/blake2) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [FSB] | [`fsb`] | [![crates.io](https://img.shields.io/crates/v/fsb.svg)](https://crates.io/crates/fsb) | [![Documentation](https://docs.rs/fsb/badge.svg)](https://docs.rs/fsb) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [GOST R 34.11-94][GOST94] | [`gost94`] | [![crates.io](https://img.shields.io/crates/v/gost94.svg)](https://crates.io/crates/gost94) | [![Documentation](https://docs.rs/gost94/badge.svg)](https://docs.rs/gost94) | ![MSRV 1.41][msrv-1.41] | :yellow_heart: | -| [Grøstl] (Groestl) | [`groestl`] | [![crates.io](https://img.shields.io/crates/v/groestl.svg)](https://crates.io/crates/groestl) | [![Documentation](https://docs.rs/groestl/badge.svg)](https://docs.rs/groestl) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [KangarooTwelve] | [`k12`] | [![crates.io](https://img.shields.io/crates/v/k12.svg)](https://crates.io/crates/k12) | [![Documentation](https://docs.rs/k12/badge.svg)](https://docs.rs/k12) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [MD2] | [`md2`] | [![crates.io](https://img.shields.io/crates/v/md2.svg)](https://crates.io/crates/md2) | [![Documentation](https://docs.rs/md2/badge.svg)](https://docs.rs/md2) | ![MSRV 1.41][msrv-1.41] | :broken_heart: | -| [MD4] | [`md4`] | [![crates.io](https://img.shields.io/crates/v/md4.svg)](https://crates.io/crates/md4) | [![Documentation](https://docs.rs/md4/badge.svg)](https://docs.rs/md4) | ![MSRV 1.41][msrv-1.41] | :broken_heart: | -| [MD5] | [`md5`] [:exclamation:] | [![crates.io](https://img.shields.io/crates/v/md-5.svg)](https://crates.io/crates/md-5) | [![Documentation](https://docs.rs/md-5/badge.svg)](https://docs.rs/md-5) | ![MSRV 1.41][msrv-1.41] | :broken_heart: | -| [RIPEMD] | [`ripemd`] | [![crates.io](https://img.shields.io/crates/v/ripemd.svg)](https://crates.io/crates/ripemd) | [![Documentation](https://docs.rs/ripemd/badge.svg)](https://docs.rs/ripemd) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [SHA-1] | [`sha1`] | [![crates.io](https://img.shields.io/crates/v/sha1.svg)](https://crates.io/crates/sha1) | [![Documentation](https://docs.rs/sha1/badge.svg)](https://docs.rs/sha1) | ![MSRV 1.41][msrv-1.41] | :broken_heart: | -| [SHA-2] | [`sha2`] | [![crates.io](https://img.shields.io/crates/v/sha2.svg)](https://crates.io/crates/sha2) | [![Documentation](https://docs.rs/sha2/badge.svg)](https://docs.rs/sha2) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [SHA-3] (Keccak) | [`sha3`] | [![crates.io](https://img.shields.io/crates/v/sha3.svg)](https://crates.io/crates/sha3) | [![Documentation](https://docs.rs/sha3/badge.svg)](https://docs.rs/sha3) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [SHABAL] | [`shabal`] | [![crates.io](https://img.shields.io/crates/v/shabal.svg)](https://crates.io/crates/shabal) | [![Documentation](https://docs.rs/shabal/badge.svg)](https://docs.rs/shabal) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [SM3] (OSCCA GM/T 0004-2012) | [`sm3`] | [![crates.io](https://img.shields.io/crates/v/sm3.svg)](https://crates.io/crates/sm3) | [![Documentation](https://docs.rs/sm3/badge.svg)](https://docs.rs/sm3) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [Streebog] (GOST R 34.11-2012) | [`streebog`] | [![crates.io](https://img.shields.io/crates/v/streebog.svg)](https://crates.io/crates/streebog) | [![Documentation](https://docs.rs/streebog/badge.svg)](https://docs.rs/streebog) | ![MSRV 1.41][msrv-1.41] | :yellow_heart: | -| [Tiger] | [`tiger`] | [![crates.io](https://img.shields.io/crates/v/tiger.svg)](https://crates.io/crates/tiger) | [![Documentation](https://docs.rs/tiger/badge.svg)](https://docs.rs/tiger) | ![MSRV 1.41][msrv-1.41] | :green_heart: | -| [Whirlpool] | [`whirlpool`] | [![crates.io](https://img.shields.io/crates/v/whirlpool.svg)](https://crates.io/crates/whirlpool) | [![Documentation](https://docs.rs/whirlpool/badge.svg)](https://docs.rs/whirlpool) | ![MSRV 1.41][msrv-1.41] | :green_heart: | +| [BLAKE2] | [`blake2`] | [![crates.io](https://img.shields.io/crates/v/blake2.svg)](https://crates.io/crates/blake2) | [![Documentation](https://docs.rs/blake2/badge.svg)](https://docs.rs/blake2) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [FSB] | [`fsb`] | [![crates.io](https://img.shields.io/crates/v/fsb.svg)](https://crates.io/crates/fsb) | [![Documentation](https://docs.rs/fsb/badge.svg)](https://docs.rs/fsb) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [GOST R 34.11-94][GOST94] | [`gost94`] | [![crates.io](https://img.shields.io/crates/v/gost94.svg)](https://crates.io/crates/gost94) | [![Documentation](https://docs.rs/gost94/badge.svg)](https://docs.rs/gost94) | ![MSRV 1.57][msrv-1.57] | :yellow_heart: | +| [Grøstl] (Groestl) | [`groestl`] | [![crates.io](https://img.shields.io/crates/v/groestl.svg)](https://crates.io/crates/groestl) | [![Documentation](https://docs.rs/groestl/badge.svg)](https://docs.rs/groestl) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [KangarooTwelve] | [`k12`] | [![crates.io](https://img.shields.io/crates/v/k12.svg)](https://crates.io/crates/k12) | [![Documentation](https://docs.rs/k12/badge.svg)](https://docs.rs/k12) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [MD2] | [`md2`] | [![crates.io](https://img.shields.io/crates/v/md2.svg)](https://crates.io/crates/md2) | [![Documentation](https://docs.rs/md2/badge.svg)](https://docs.rs/md2) | ![MSRV 1.57][msrv-1.57] | :broken_heart: | +| [MD4] | [`md4`] | [![crates.io](https://img.shields.io/crates/v/md4.svg)](https://crates.io/crates/md4) | [![Documentation](https://docs.rs/md4/badge.svg)](https://docs.rs/md4) | ![MSRV 1.57][msrv-1.57] | :broken_heart: | +| [MD5] | [`md5`] [:exclamation:] | [![crates.io](https://img.shields.io/crates/v/md-5.svg)](https://crates.io/crates/md-5) | [![Documentation](https://docs.rs/md-5/badge.svg)](https://docs.rs/md-5) | ![MSRV 1.57][msrv-1.57] | :broken_heart: | +| [RIPEMD] | [`ripemd`] | [![crates.io](https://img.shields.io/crates/v/ripemd.svg)](https://crates.io/crates/ripemd) | [![Documentation](https://docs.rs/ripemd/badge.svg)](https://docs.rs/ripemd) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [SHA-1] | [`sha1`] | [![crates.io](https://img.shields.io/crates/v/sha1.svg)](https://crates.io/crates/sha1) | [![Documentation](https://docs.rs/sha1/badge.svg)](https://docs.rs/sha1) | ![MSRV 1.57][msrv-1.57] | :broken_heart: | +| [SHA-2] | [`sha2`] | [![crates.io](https://img.shields.io/crates/v/sha2.svg)](https://crates.io/crates/sha2) | [![Documentation](https://docs.rs/sha2/badge.svg)](https://docs.rs/sha2) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [SHA-3] (Keccak) | [`sha3`] | [![crates.io](https://img.shields.io/crates/v/sha3.svg)](https://crates.io/crates/sha3) | [![Documentation](https://docs.rs/sha3/badge.svg)](https://docs.rs/sha3) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [SHABAL] | [`shabal`] | [![crates.io](https://img.shields.io/crates/v/shabal.svg)](https://crates.io/crates/shabal) | [![Documentation](https://docs.rs/shabal/badge.svg)](https://docs.rs/shabal) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [SM3] (OSCCA GM/T 0004-2012) | [`sm3`] | [![crates.io](https://img.shields.io/crates/v/sm3.svg)](https://crates.io/crates/sm3) | [![Documentation](https://docs.rs/sm3/badge.svg)](https://docs.rs/sm3) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [Streebog] (GOST R 34.11-2012) | [`streebog`] | [![crates.io](https://img.shields.io/crates/v/streebog.svg)](https://crates.io/crates/streebog) | [![Documentation](https://docs.rs/streebog/badge.svg)](https://docs.rs/streebog) | ![MSRV 1.57][msrv-1.57] | :yellow_heart: | +| [Tiger] | [`tiger`] | [![crates.io](https://img.shields.io/crates/v/tiger.svg)](https://crates.io/crates/tiger) | [![Documentation](https://docs.rs/tiger/badge.svg)](https://docs.rs/tiger) | ![MSRV 1.57][msrv-1.57] | :green_heart: | +| [Whirlpool] | [`whirlpool`] | [![crates.io](https://img.shields.io/crates/v/whirlpool.svg)](https://crates.io/crates/whirlpool) | [![Documentation](https://docs.rs/whirlpool/badge.svg)](https://docs.rs/whirlpool) | ![MSRV 1.57][msrv-1.57] | :green_heart: | NOTE: the [`blake3`] crate implements the `digest` traits used by the rest of the hashes in this repository, but is maintained by the BLAKE3 team. @@ -230,7 +230,6 @@ Unless you explicitly state otherwise, any contribution intentionally submitted [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [deps-image]: https://deps.rs/repo/github/RustCrypto/hashes/status.svg [deps-link]: https://deps.rs/repo/github/RustCrypto/hashes -[msrv-1.41]: https://img.shields.io/badge/rustc-1.41.0+-blue.svg [msrv-1.57]: https://img.shields.io/badge/rustc-1.57.0+-blue.svg [//]: # (crates) diff --git a/belt-hash/Cargo.toml b/belt-hash/Cargo.toml index 14891c809..bc3a7cc21 100644 --- a/belt-hash/Cargo.toml +++ b/belt-hash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "belt-hash" -version = "0.1.0" +version = "0.2.0" description = "BelT hash function (STB 34.101.31-2020)" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" @@ -13,18 +13,14 @@ keywords = ["crypto", "belt", "stb", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" belt-block = { version = "0.1.1", default-features = false } [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } +digest = { version = "0.11.0-pre", features = ["dev"] } hex-literal = "0.3.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] - -# TODO: remove when crate will be part of the root workspace -[profile.dev] -opt-level = 2 +oid = ["digest/oid"] # Enable OID support diff --git a/belt-hash/src/lib.rs b/belt-hash/src/lib.rs index 925ca6094..7b618f622 100644 --- a/belt-hash/src/lib.rs +++ b/belt-hash/src/lib.rs @@ -111,7 +111,7 @@ impl FixedOutputCore for BeltHashCore { let pos = buffer.get_pos(); if pos != 0 { let block = buffer.pad_with_zeros(); - self.compress_block(block); + self.compress_block(&block); } let bs = Self::BlockSize::USIZE as u128; let r = encode_r(8 * ((bs * self.r) + pos as u128)); diff --git a/belt-hash/tests/mod.rs b/belt-hash/tests/mod.rs index d8259a128..5b6e7de61 100644 --- a/belt-hash/tests/mod.rs +++ b/belt-hash/tests/mod.rs @@ -11,10 +11,11 @@ fn belt_rand() { let mut h = BeltHash::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], + h.finalize(), hex!( "a45053f80827d530008198c8185aa507" "403b4a21f591579f07c34358e5991754" - )[..] + ) + .into() ); } diff --git a/blake2/Cargo.toml b/blake2/Cargo.toml index 11c00ac01..6f45c1341 100644 --- a/blake2/Cargo.toml +++ b/blake2/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "blake2" -version = "0.10.6" +version = "0.11.0" description = "BLAKE2 hash functions" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/blake2" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "blake2", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = { version = "0.10.3", features = ["mac"] } +digest = { version = "0.11.0-pre", features = ["mac"] } [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] default = ["std"] diff --git a/blake2/README.md b/blake2/README.md index 913b729e9..139c390f7 100644 --- a/blake2/README.md +++ b/blake2/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [BLAKE2 hash function][1] family. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -47,7 +47,7 @@ dual licensed as above, without any additional terms or conditions. [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [build-image]: https://github.com/RustCrypto/hashes/workflows/blake2/badge.svg?branch=master [build-link]: https://github.com/RustCrypto/hashes/actions?query=workflow%3Ablake2 diff --git a/blake2/src/macros.rs b/blake2/src/macros.rs index 917a212c8..fc4ec886a 100644 --- a/blake2/src/macros.rs +++ b/blake2/src/macros.rs @@ -224,7 +224,7 @@ macro_rules! blake2_impl { ) { self.t += buffer.get_pos() as u64; let block = buffer.pad_with_zeros(); - self.finalize_with_flag(block, 0, out); + self.finalize_with_flag(&block, 0, out); } } diff --git a/blake2/tests/mac.rs b/blake2/tests/mac.rs index 97fbc9d70..fe44ac6d7 100644 --- a/blake2/tests/mac.rs +++ b/blake2/tests/mac.rs @@ -12,11 +12,11 @@ fn blake2b_new_test() { fn run(key: &[u8]) { const DATA: &[u8] = &[42; 300]; - let res1 = ::new(GenericArray::from_slice(key)) + let res1 = T::new(GenericArray::from_slice(key)) .chain_update(DATA) .finalize() .into_bytes(); - let res2 = ::new_from_slice(&key) + let res2 = T::new_from_slice(&key) .unwrap() .chain_update(DATA) .finalize() diff --git a/blake2/tests/persona.rs b/blake2/tests/persona.rs index 49e6574e9..f4716293d 100644 --- a/blake2/tests/persona.rs +++ b/blake2/tests/persona.rs @@ -2,39 +2,39 @@ use blake2::{digest::FixedOutput, Blake2bMac512, Blake2sMac256}; use hex_literal::hex; #[test] -#[rustfmt::skip] fn blake2s_persona() { - let key= hex!(" - 000102030405060708090a0b0c0d0e0f - 101112131415161718191a1b1c1d1e1f - "); + let key = hex!( + "000102030405060708090a0b0c0d0e0f" + "101112131415161718191a1b1c1d1e1f" + ); let persona = b"personal"; let ctx = Blake2sMac256::new_with_salt_and_personal(&key, &[], persona).unwrap(); assert_eq!( - ctx.finalize_fixed()[..], - hex!(" - 25a4ee63b594aed3f88a971e1877ef70 - 99534f9097291f88fb86c79b5e70d022 - ")[..], + ctx.finalize_fixed(), + hex!( + "25a4ee63b594aed3f88a971e1877ef70" + "99534f9097291f88fb86c79b5e70d022" + ) + .into(), ); } #[test] -#[rustfmt::skip] fn blake2b_persona() { - let key = hex!(" - 000102030405060708090a0b0c0d0e0f - 101112131415161718191a1b1c1d1e1f - "); + let key = hex!( + "000102030405060708090a0b0c0d0e0f" + "101112131415161718191a1b1c1d1e1f" + ); let persona = b"personal"; let ctx = Blake2bMac512::new_with_salt_and_personal(&key, &[], persona).unwrap(); assert_eq!( - ctx.finalize_fixed()[..], - hex!(" - 03de3b295dcfc3b25b05abb09bc95fe3 - e9ff3073638badc68101d1e42019d077 - 1dd07525a3aae8318e92c5e5d967ba92 - e4810d0021d7bf3b49da0b4b4a8a4e1f - ")[..], + ctx.finalize_fixed(), + hex!( + "03de3b295dcfc3b25b05abb09bc95fe3" + "e9ff3073638badc68101d1e42019d077" + "1dd07525a3aae8318e92c5e5d967ba92" + "e4810d0021d7bf3b49da0b4b4a8a4e1f" + ) + .into(), ); } diff --git a/fsb/Cargo.toml b/fsb/Cargo.toml index 8e652f3e9..cc24fa590 100644 --- a/fsb/Cargo.toml +++ b/fsb/Cargo.toml @@ -1,23 +1,24 @@ [package] name = "fsb" -version = "0.1.3" +version = "0.2.0" description = "FSB hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/fsb" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "fsb", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" -whirlpool = { version = "0.10.1", path = "../whirlpool", default-features = false } +digest = "0.11.0-pre" +whirlpool = { version = "0.11", path = "../whirlpool", default-features = false } [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] default = ["std"] diff --git a/fsb/README.md b/fsb/README.md index bff04069c..2cb95e30f 100644 --- a/fsb/README.md +++ b/fsb/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [FSB hash function][1] family. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. diff --git a/fsb/tests/mod.rs b/fsb/tests/mod.rs index 928f1b979..a6edd6366 100644 --- a/fsb/tests/mod.rs +++ b/fsb/tests/mod.rs @@ -14,8 +14,8 @@ fn fsb160_rand() { let mut h = Fsb160::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("40b7538be5e51978690d1a92fe12a7f25f0a7f08")[..] + h.finalize(), + hex!("40b7538be5e51978690d1a92fe12a7f25f0a7f08").into(), ); } @@ -24,8 +24,8 @@ fn fsb224_rand() { let mut h = Fsb224::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("0ec203ccec7cbf0cadd32e5dc069d0b4215a104c4dad5444944a0d09")[..] + h.finalize(), + hex!("0ec203ccec7cbf0cadd32e5dc069d0b4215a104c4dad5444944a0d09").into(), ); } @@ -34,35 +34,35 @@ fn fsb256_rand() { let mut h = Fsb256::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("eecb42832a2b03bc91beb1a56ddf2973c962b1aeb22f278e9d78a7a8879ebba7")[..] + h.finalize(), + hex!("eecb42832a2b03bc91beb1a56ddf2973c962b1aeb22f278e9d78a7a8879ebba7").into(), ); } #[test] -#[rustfmt::skip] fn fsb384_rand() { let mut h = Fsb384::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - f17533ed4d4484434715e63bc8e801c9cfe988c38d47d3b4be0409571360aa2f - b360b2804c14f606906b323e7901c09e - ")[..] + h.finalize(), + hex!( + "f17533ed4d4484434715e63bc8e801c9cfe988c38d47d3b4be0409571360aa2f" + "b360b2804c14f606906b323e7901c09e" + ) + .into() ); } #[test] -#[rustfmt::skip] fn fsb512_rand() { let mut h = Fsb512::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 957a7733643e075ab7a3b04607800a6208a26b008bdaee759a3a635bb9b5b708 - 3531725783505468bf438f2a0a96163bbe0775468a11c93db9994c466b2e7d8c - ")[..] + h.finalize(), + hex!( + "957a7733643e075ab7a3b04607800a6208a26b008bdaee759a3a635bb9b5b708" + "3531725783505468bf438f2a0a96163bbe0775468a11c93db9994c466b2e7d8c" + ) + .into() ); } diff --git a/gost94/Cargo.toml b/gost94/Cargo.toml index 19c8472d4..ca554cf02 100644 --- a/gost94/Cargo.toml +++ b/gost94/Cargo.toml @@ -1,24 +1,25 @@ [package] name = "gost94" -version = "0.10.4" +version = "0.11.0" description = "GOST R 34.11-94 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/gost94" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "gost94", "gost", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support diff --git a/gost94/README.md b/gost94/README.md index a1bd9fd98..b86b32d09 100644 --- a/gost94/README.md +++ b/gost94/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [GOST R 34.11-94 hash function][1]. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/gost94/badge.svg [docs-link]: https://docs.rs/gost94/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/gost94/badge.svg?branch=master diff --git a/groestl/Cargo.toml b/groestl/Cargo.toml index 463078c1b..fe2de8b65 100644 --- a/groestl/Cargo.toml +++ b/groestl/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "groestl" -version = "0.10.1" +version = "0.11.0" description = "Grøstl hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/groestl" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "groestl", "grostl", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] default = ["std"] diff --git a/groestl/README.md b/groestl/README.md index b22a23313..f30bb7dfd 100644 --- a/groestl/README.md +++ b/groestl/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [Grøstl hash function][1]. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/groestl/badge.svg [docs-link]: https://docs.rs/groestl/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/groestl/badge.svg?branch=master diff --git a/groestl/tests/mod.rs b/groestl/tests/mod.rs index 41a5cf261..e6c4bf1d9 100755 --- a/groestl/tests/mod.rs +++ b/groestl/tests/mod.rs @@ -13,8 +13,8 @@ fn groestl224_rand() { let mut h = Groestl224::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("2000744c2f85a7fb4733e97da8db00069dd6defa9186dac3461dfeb8")[..] + h.finalize(), + hex!("2000744c2f85a7fb4733e97da8db00069dd6defa9186dac3461dfeb8").into(), ); } @@ -23,35 +23,35 @@ fn groestl256_rand() { let mut h = Groestl256::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("aac71c789678f627a6474605322ae98d1647e47f405d00b1461b90ee5f0cfbc4")[..] + h.finalize(), + hex!("aac71c789678f627a6474605322ae98d1647e47f405d00b1461b90ee5f0cfbc4").into(), ); } #[test] -#[rustfmt::skip] fn groestl384_rand() { let mut h = Groestl384::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - dab78eea895a6dde0c53dc02fc79c7986f5d6811618ca6e5922f01e8aca9bfeb - 20ed5eda4130bf0ab474ac0b6f0290f8 - ")[..] + h.finalize(), + hex!( + "dab78eea895a6dde0c53dc02fc79c7986f5d6811618ca6e5922f01e8aca9bfeb" + "20ed5eda4130bf0ab474ac0b6f0290f8" + ) + .into(), ); } #[test] -#[rustfmt::skip] fn groestl512_rand() { let mut h = Groestl512::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 7e4d8257c217c7ae59331126e0f984f145e9789862de7c099675ac29e46424ef - e93543974fa7113190d492f607f629a03db35ec5551abcb2785ae145fd3c543f - ")[..], + h.finalize(), + hex!( + "7e4d8257c217c7ae59331126e0f984f145e9789862de7c099675ac29e46424ef" + "e93543974fa7113190d492f607f629a03db35ec5551abcb2785ae145fd3c543f" + ) + .into(), ); } diff --git a/k12/Cargo.toml b/k12/Cargo.toml index ada20f487..58373e54c 100644 --- a/k12/Cargo.toml +++ b/k12/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "k12" -version = "0.2.1" +version = "0.3.0" description = "Experimental pure Rust implementation of the KangarooTwelve hash function" authors = ["Diggory Hardy "] license = "Apache-2.0 OR MIT" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/k12" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = { version = "0.10.3", features = ["alloc"] } +digest = { version = "0.11.0-pre", features = ["alloc"] } [dev-dependencies] -digest = { version = "0.10.3", features = ["alloc", "dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["alloc", "dev"] } +hex-literal = "0.3.3" [features] default = ["std"] diff --git a/k12/README.md b/k12/README.md index 844711ff4..7ffb9a6cf 100644 --- a/k12/README.md +++ b/k12/README.md @@ -13,7 +13,7 @@ function (XOF). ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/k12/badge.svg [docs-link]: https://docs.rs/k12/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/k12/badge.svg?branch=master diff --git a/k12/tests/mod.rs b/k12/tests/mod.rs index bd27c4464..cd40e54d3 100644 --- a/k12/tests/mod.rs +++ b/k12/tests/mod.rs @@ -12,7 +12,6 @@ fn digest_and_box(data: &[u8], n: usize) -> Box<[u8]> { } #[test] -#[rustfmt::skip] fn empty() { // Source: reference paper assert_eq!( @@ -22,10 +21,10 @@ fn empty() { assert_eq!( digest_and_box(b"", 64)[..], - hex!(" - 1ac2d450fc3b4205d19da7bfca1b37513c0803577ac7167f06fe2ce1f0ef39e5 - 4269c056b8c82e48276038b6d292966cc07a3d4645272e31ff38508139eb0a71 - ")[..] + hex!( + "1ac2d450fc3b4205d19da7bfca1b37513c0803577ac7167f06fe2ce1f0ef39e5" + "4269c056b8c82e48276038b6d292966cc07a3d4645272e31ff38508139eb0a71" + )[..] ); assert_eq!( diff --git a/md2/Cargo.toml b/md2/Cargo.toml index 234c4ada2..715c0ef69 100644 --- a/md2/Cargo.toml +++ b/md2/Cargo.toml @@ -1,24 +1,25 @@ [package] name = "md2" -version = "0.10.2" +version = "0.11.0" license = "MIT OR Apache-2.0" authors = ["RustCrypto Developers"] description = "MD2 hash function" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/md2" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "md2", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] oid = ["digest/oid"] diff --git a/md2/README.md b/md2/README.md index 877765562..f6a6d209d 100644 --- a/md2/README.md +++ b/md2/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [MD2 hash function][1]. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/md2/badge.svg [docs-link]: https://docs.rs/md2/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/md2/badge.svg?branch=master diff --git a/md2/src/lib.rs b/md2/src/lib.rs index 9ab2750b1..773bbb878 100644 --- a/md2/src/lib.rs +++ b/md2/src/lib.rs @@ -109,10 +109,10 @@ impl FixedOutputCore for Md2Core { fn finalize_fixed_core(&mut self, buffer: &mut Buffer, out: &mut Output) { let pos = buffer.get_pos(); let rem = buffer.remaining() as u8; - let block = buffer.pad_with_zeros(); + let mut block = buffer.pad_with_zeros(); block[pos..].iter_mut().for_each(|b| *b = rem); - self.compress(block); + self.compress(&block); let checksum = self.checksum; self.compress(&checksum); out.copy_from_slice(&self.x[0..16]); diff --git a/md4/Cargo.toml b/md4/Cargo.toml index 78faeb71d..58217b1d6 100644 --- a/md4/Cargo.toml +++ b/md4/Cargo.toml @@ -1,24 +1,25 @@ [package] name = "md4" -version = "0.10.2" +version = "0.11.0" description = "MD4 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/md4" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "md4", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support diff --git a/md4/README.md b/md4/README.md index 867b69e5e..ba04d872f 100644 --- a/md4/README.md +++ b/md4/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [MD4 hash function][1]. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/md4/badge.svg [docs-link]: https://docs.rs/md4/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/md4/badge.svg?branch=master diff --git a/md5/Cargo.toml b/md5/Cargo.toml index 48fd5aff7..5bb60d8a3 100644 --- a/md5/Cargo.toml +++ b/md5/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "md-5" -version = "0.10.5" +version = "0.11.0" description = "MD5 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/md-5" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "md5", "hash", "digest"] @@ -15,17 +16,17 @@ categories = ["cryptography", "no-std"] name = "md5" [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] md5-asm = { version = "0.5", optional = true } [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] asm = ["md5-asm"] # WARNING: this feature SHOULD NOT be enabled by library crates -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support diff --git a/md5/README.md b/md5/README.md index 56af1749b..7d3358401 100644 --- a/md5/README.md +++ b/md5/README.md @@ -26,7 +26,7 @@ including HMAC-MD5. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -58,7 +58,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/md-5/badge.svg [docs-link]: https://docs.rs/md-5/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/md5/badge.svg?branch=master diff --git a/ripemd/Cargo.toml b/ripemd/Cargo.toml index 3e8394d04..d30f95fbc 100644 --- a/ripemd/Cargo.toml +++ b/ripemd/Cargo.toml @@ -1,24 +1,25 @@ [package] name = "ripemd" -version = "0.1.3" +version = "0.2.0" description = "Pure Rust implementation of the RIPEMD hash functions" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/ripemd" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "ripemd", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support diff --git a/ripemd/README.md b/ripemd/README.md index c09878fe5..62bf9f389 100644 --- a/ripemd/README.md +++ b/ripemd/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [RIPEMD] hash functions. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/ripemd/badge.svg [docs-link]: https://docs.rs/ripemd/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/ripemd/badge.svg?branch=master diff --git a/ripemd/tests/mod.rs b/ripemd/tests/mod.rs index 0dd16b0cf..fb05221da 100644 --- a/ripemd/tests/mod.rs +++ b/ripemd/tests/mod.rs @@ -20,7 +20,7 @@ fn ripemd128_1mil_a() { } assert_eq!( h.finalize(), - hex!("4a7f5723f954eba1216c9d8f6320431f").into() + hex!("4a7f5723f954eba1216c9d8f6320431f").into(), ); } @@ -29,8 +29,8 @@ fn ripemd128_rand() { let mut h = Ripemd128::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("01eb52529bcec15bd0cb4040ec998632")[..] + h.finalize(), + hex!("01eb52529bcec15bd0cb4040ec998632").into(), ); } @@ -43,7 +43,7 @@ fn ripemd160_1mil_a() { } assert_eq!( h.finalize(), - hex!("52783243c1697bdbe16d37f97f68f08325dc1528").into() + hex!("52783243c1697bdbe16d37f97f68f08325dc1528").into(), ); } @@ -52,8 +52,8 @@ fn ripemd160_rand() { let mut h = Ripemd160::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("bcd8c672932125776af3c60eeeb58bbaf206f386")[..] + h.finalize(), + hex!("bcd8c672932125776af3c60eeeb58bbaf206f386").into(), ); } @@ -66,7 +66,7 @@ fn ripemd256_1mil_a() { } assert_eq!( h.finalize(), - hex!("ac953744e10e31514c150d4d8d7b677342e33399788296e43ae4850ce4f97978").into() + hex!("ac953744e10e31514c150d4d8d7b677342e33399788296e43ae4850ce4f97978").into(), ); } @@ -75,13 +75,12 @@ fn ripemd256_rand() { let mut h = Ripemd256::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("6492ffe075896441b737900bdf58fc960e77477e42a2a61bc02c66fd689b69d0")[..] + h.finalize(), + hex!("6492ffe075896441b737900bdf58fc960e77477e42a2a61bc02c66fd689b69d0").into(), ); } #[test] -#[rustfmt::skip] fn ripemd320_1mil_a() { let mut h = Ripemd320::new(); let buf = [b'a'; 1000]; @@ -90,23 +89,24 @@ fn ripemd320_1mil_a() { } assert_eq!( h.finalize(), - hex!(" - bdee37f4371e20646b8b0d862dda16292ae36f40 - 965e8c8509e63d1dbddecc503e2b63eb9245bb66 - ").into() + hex!( + "bdee37f4371e20646b8b0d862dda16292ae36f40" + "965e8c8509e63d1dbddecc503e2b63eb9245bb66" + ) + .into(), ); } #[test] -#[rustfmt::skip] fn ripemd320_rand() { let mut h = Ripemd320::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 3a905312162c5c173639f6cc1cdf51d14e8bda02 - 865767592e26d9343fbec348ce55ce39b4b4b56f - ")[..] + h.finalize(), + hex!( + "3a905312162c5c173639f6cc1cdf51d14e8bda02" + "865767592e26d9343fbec348ce55ce39b4b4b56f" + ) + .into() ); } diff --git a/sha1/Cargo.toml b/sha1/Cargo.toml index 8ff801508..27a5040e2 100644 --- a/sha1/Cargo.toml +++ b/sha1/Cargo.toml @@ -1,18 +1,19 @@ [package] name = "sha1" -version = "0.10.5" +version = "0.11.0" description = "SHA-1 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/sha1" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sha1", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" cfg-if = "1.0" [target.'cfg(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64"))'.dependencies] @@ -20,13 +21,13 @@ cpufeatures = "0.2" sha1-asm = { version = "0.5", optional = true } [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } +digest = { version = "0.11.0-pre", features = ["dev"] } hex-literal = "0.2.2" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support asm = ["sha1-asm"] # WARNING: this feature SHOULD NOT be enabled by library crates compress = [] # Expose compress function force-soft = [] # Force software implementation diff --git a/sha1/README.md b/sha1/README.md index bd76f0973..96a393737 100644 --- a/sha1/README.md +++ b/sha1/README.md @@ -21,7 +21,7 @@ We provide this crate for legacy interoperability purposes only. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -53,7 +53,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/sha1/badge.svg [docs-link]: https://docs.rs/sha1/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/sha1/badge.svg?branch=master diff --git a/sha2/Cargo.toml b/sha2/Cargo.toml index 9d8dedb03..722f4f435 100644 --- a/sha2/Cargo.toml +++ b/sha2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sha2" -version = "0.10.6" +version = "0.11.0" description = """ Pure Rust implementation of the SHA-2 hash function family including SHA-224, SHA-256, SHA-384, and SHA-512. @@ -8,14 +8,15 @@ including SHA-224, SHA-256, SHA-384, and SHA-512. authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/sha2" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sha2", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" cfg-if = "1.0" [target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies] @@ -23,13 +24,13 @@ cpufeatures = "0.2" sha2-asm = { version = "0.6.1", optional = true } [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support asm = ["sha2-asm"] # WARNING: this feature SHOULD NOT be enabled by library crates compress = [] # Expose compress functions force-soft = [] # Force software implementation diff --git a/sha2/README.md b/sha2/README.md index 594e95324..f2ec3af53 100644 --- a/sha2/README.md +++ b/sha2/README.md @@ -16,7 +16,7 @@ including SHA-224, SHA-256, SHA-384, and SHA-512. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -48,7 +48,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/sha2/badge.svg [docs-link]: https://docs.rs/sha2/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/sha2/badge.svg?branch=master diff --git a/sha2/tests/mod.rs b/sha2/tests/mod.rs index 91df4683b..e8a9daad8 100644 --- a/sha2/tests/mod.rs +++ b/sha2/tests/mod.rs @@ -15,21 +15,21 @@ fn sha256_rand() { let mut h = Sha256::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("45f51fead87328fe837a86f4f1ac0eb15116ab1473adc0423ef86c62eb2320c7")[..] + h.finalize(), + hex!("45f51fead87328fe837a86f4f1ac0eb15116ab1473adc0423ef86c62eb2320c7").into(), ); } #[test] -#[rustfmt::skip] fn sha512_rand() { let mut h = Sha512::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 9084d75a7c0721541d737b6171eb465dc9ba08a119a182a8508484aa27a176cd - e7c2103b108393eb024493ced4aac56be6f57222cac41b801f11494886264997 - ")[..] + h.finalize(), + hex!( + "9084d75a7c0721541d737b6171eb465dc9ba08a119a182a8508484aa27a176cd" + "e7c2103b108393eb024493ced4aac56be6f57222cac41b801f11494886264997" + ) + .into(), ); } diff --git a/sha3/Cargo.toml b/sha3/Cargo.toml index 787290284..571b54cb5 100644 --- a/sha3/Cargo.toml +++ b/sha3/Cargo.toml @@ -1,28 +1,29 @@ [package] name = "sha3" -version = "0.10.6" +version = "0.11.0" description = "SHA-3 (Keccak) hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/sha3" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sha3", "keccak", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" keccak = "0.1.3" [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] asm = ["keccak/asm"] # Enable ASM (currently ARMv8 only). WARNING: Bumps MSRV to 1.59 -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support reset = [] # Enable reset functionality diff --git a/sha3/README.md b/sha3/README.md index caef5d594..8b387a8c3 100644 --- a/sha3/README.md +++ b/sha3/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [SHA-3 (Keccak) hash function][1]. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/sha3/badge.svg [docs-link]: https://docs.rs/sha3/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/sha3/badge.svg?branch=master diff --git a/sha3/src/macros.rs b/sha3/src/macros.rs index 4b8397d44..f4b6a88ee 100644 --- a/sha3/src/macros.rs +++ b/sha3/src/macros.rs @@ -39,12 +39,12 @@ macro_rules! impl_sha3 { #[inline] fn finalize_fixed_core(&mut self, buffer: &mut Buffer, out: &mut Output) { let pos = buffer.get_pos(); - let block = buffer.pad_with_zeros(); + let mut block = buffer.pad_with_zeros(); block[pos] = $pad; let n = block.len(); block[n - 1] |= 0x80; - self.state.absorb_block(block); + self.state.absorb_block(&block); self.state.as_bytes(out); } @@ -135,12 +135,12 @@ macro_rules! impl_shake { #[inline] fn finalize_xof_core(&mut self, buffer: &mut Buffer) -> Self::ReaderCore { let pos = buffer.get_pos(); - let block = buffer.pad_with_zeros(); + let mut block = buffer.pad_with_zeros(); block[pos] = $pad; let n = block.len(); block[n - 1] |= 0x80; - self.state.absorb_block(block); + self.state.absorb_block(&block); $reader { state: self.state.clone(), } @@ -298,7 +298,7 @@ macro_rules! impl_cshake { state.absorb_block(block); } }); - state.absorb_block(buffer.pad_with_zeros()); + state.absorb_block(&buffer.pad_with_zeros()); Self { padding: $cshake_pad, @@ -334,12 +334,12 @@ macro_rules! impl_cshake { #[inline] fn finalize_xof_core(&mut self, buffer: &mut Buffer) -> Self::ReaderCore { let pos = buffer.get_pos(); - let block = buffer.pad_with_zeros(); + let mut block = buffer.pad_with_zeros(); block[pos] = self.padding; let n = block.len(); block[n - 1] |= 0x80; - self.state.absorb_block(block); + self.state.absorb_block(&block); $reader { state: self.state.clone(), } diff --git a/shabal/Cargo.toml b/shabal/Cargo.toml index dc5d0dbec..69d6882d7 100644 --- a/shabal/Cargo.toml +++ b/shabal/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "shabal" -version = "0.4.1" +version = "0.5.0" description = "Shabal hash functions" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/shabal" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "shabal", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] default = ["std"] diff --git a/shabal/README.md b/shabal/README.md index e48a1cd26..8e997c6ff 100644 --- a/shabal/README.md +++ b/shabal/README.md @@ -42,7 +42,7 @@ assert_eq!(result[..], hex!("d945dee21ffca23ac232763aa9cac6c15805f144db9d6c97395 ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -74,7 +74,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/shabal/badge.svg [docs-link]: https://docs.rs/shabal/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/shabal/badge.svg?branch=master diff --git a/shabal/src/core_api.rs b/shabal/src/core_api.rs index 561117522..89ba5fd16 100644 --- a/shabal/src/core_api.rs +++ b/shabal/src/core_api.rs @@ -216,10 +216,10 @@ impl VariableOutputCore for ShabalVarCore { #[inline] fn finalize_variable_core(&mut self, buffer: &mut Buffer, out: &mut Output) { let pos = buffer.get_pos(); - let block = buffer.pad_with_zeros(); + let mut block = buffer.pad_with_zeros(); block[pos] = 0x80; - let m = read_m(block); + let m = read_m(&block); self.add_m(&m); self.xor_w(); self.perm(&m); diff --git a/shabal/tests/mod.rs b/shabal/tests/mod.rs index 0e43643d4..50d554668 100644 --- a/shabal/tests/mod.rs +++ b/shabal/tests/mod.rs @@ -16,8 +16,8 @@ fn shabal192_rand() { let mut h = Shabal192::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("a3e480026be158db97976a895b7a015e9e5205986ebc8a89")[..] + h.finalize(), + hex!("a3e480026be158db97976a895b7a015e9e5205986ebc8a89").into(), ); } @@ -26,8 +26,8 @@ fn shabal224_rand() { let mut h = Shabal224::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("a09bedfed92fdffc896e6043ec175aa1f07383c65bde990a3661e3d0")[..] + h.finalize(), + hex!("a09bedfed92fdffc896e6043ec175aa1f07383c65bde990a3661e3d0").into(), ); } @@ -36,35 +36,35 @@ fn shabal256_rand() { let mut h = Shabal256::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("53252a6467450aa1afc1ac25efb493aa65b70e5b2280a4bed7f672c0cfe6f40e")[..] + h.finalize(), + hex!("53252a6467450aa1afc1ac25efb493aa65b70e5b2280a4bed7f672c0cfe6f40e").into(), ); } #[test] -#[rustfmt::skip] fn shabal384_rand() { let mut h = Shabal384::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 15b8ece81e490848c997dba603523be8842c654262e5adc29138d22a01ff0c9f - 2b0a0dc9f3e7702ac3598fb1b9ff2db2 - ")[..] + h.finalize(), + hex!( + "15b8ece81e490848c997dba603523be8842c654262e5adc29138d22a01ff0c9f" + "2b0a0dc9f3e7702ac3598fb1b9ff2db2" + ) + .into(), ); } #[test] -#[rustfmt::skip] fn shabal512_rand() { let mut h = Shabal512::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 66f091bc2ba6c571a776441c08ee0711752344ba8b4c88ea17a078baa70d8c0a - 717b7da24e765867cfcf273a43a58f90e07c0130d1e97adc49f66a0502536e82 - ")[..] + h.finalize(), + hex!( + "66f091bc2ba6c571a776441c08ee0711752344ba8b4c88ea17a078baa70d8c0a" + "717b7da24e765867cfcf273a43a58f90e07c0130d1e97adc49f66a0502536e82" + ) + .into(), ); } diff --git a/sm3/Cargo.toml b/sm3/Cargo.toml index 0de39ecc0..e164fb340 100644 --- a/sm3/Cargo.toml +++ b/sm3/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "sm3" -version = "0.4.1" +version = "0.5.0" description = "SM3 (OSCCA GM/T 0004-2012) hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/sm3" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sm3", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] default = ["std"] diff --git a/sm3/README.md b/sm3/README.md index 29bdcf63e..244b66549 100644 --- a/sm3/README.md +++ b/sm3/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [SM3 (OSCCA GM/T 0004-2012)][1] hash function. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/sm3/badge.svg [docs-link]: https://docs.rs/sm3/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/sm3/badge.svg?branch=master diff --git a/streebog/Cargo.toml b/streebog/Cargo.toml index ea3fd1254..a60bf2ee0 100644 --- a/streebog/Cargo.toml +++ b/streebog/Cargo.toml @@ -1,24 +1,25 @@ [package] name = "streebog" -version = "0.10.2" +version = "0.11.0" description = "Streebog (GOST R 34.11-2012) hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/streebog" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "streebog", "gost", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] -default = ["std"] +default = ["std", "oid"] std = ["digest/std"] -oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57 +oid = ["digest/oid"] # Enable OID support diff --git a/streebog/README.md b/streebog/README.md index b8b4c7acc..c19d5e0aa 100644 --- a/streebog/README.md +++ b/streebog/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [Streebog (GOST R 34.11-2012)][1] hash function. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/streebog/badge.svg [docs-link]: https://docs.rs/streebog/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/streebog/badge.svg?branch=master diff --git a/streebog/src/core_api.rs b/streebog/src/core_api.rs index a9bd09b06..d143aedcf 100644 --- a/streebog/src/core_api.rs +++ b/streebog/src/core_api.rs @@ -140,7 +140,7 @@ impl VariableOutputCore for StreebogVarCore { #[inline] fn finalize_variable_core(&mut self, buffer: &mut Buffer, out: &mut Output) { let pos = buffer.get_pos(); - let block = buffer.pad_with_zeros(); + let mut block = buffer.pad_with_zeros(); block[pos] = 1; self.compress(block.as_ref(), pos as u64); self.g(&[0u8; 64], &to_bytes(&self.n)); diff --git a/streebog/tests/mod.rs b/streebog/tests/mod.rs index aeddaefd1..97ac79c6a 100644 --- a/streebog/tests/mod.rs +++ b/streebog/tests/mod.rs @@ -21,7 +21,6 @@ new_test!( /// Test vectors from: /// https://github.com/gost-engine/engine/blob/master/test/01-digest.t #[test] -#[rustfmt::skip] fn gost_engine_tests() { let h256 = &mut streebog::Streebog256::new(); let h512 = &mut streebog::Streebog512::new(); @@ -39,24 +38,26 @@ fn gost_engine_tests() { update(h256, h512, b"12345670"); } check( - h256, h512, + h256, + h512, hex!("1906512b86a1283c68cec8419e57113efc562a1d0e95d8f4809542900c416fe4"), - hex!(" - 283587e434864d0d4bea97c0fb10e2dd421572fc859304bdf6a94673d652c590 - 49212bad7802b4fcf5eecc1f8fab569d60f2c20dbd789a7fe4efbd79d8137ee7 - "), + hex!( + "283587e434864d0d4bea97c0fb10e2dd421572fc859304bdf6a94673d652c590" + "49212bad7802b4fcf5eecc1f8fab569d60f2c20dbd789a7fe4efbd79d8137ee7" + ), ); for _ in 0..128 { update(h256, h512, &hex!("0001021584674531")); } check( - h256, h512, + h256, + h512, hex!("2eb1306be3e490f18ff0e2571a077b3831c815c46c7d4fdf9e0e26de4032b3f3"), - hex!(" - 55656e5bcf795b499031a7833cd7dc18fe10d4a47e15be545c6ab3f304a4fe41 - 1c4c39de5b1fc6844880111441e0b92bf1ec2fb7840453fe39a2b70ced461968 - "), + hex!( + "55656e5bcf795b499031a7833cd7dc18fe10d4a47e15be545c6ab3f304a4fe41" + "1c4c39de5b1fc6844880111441e0b92bf1ec2fb7840453fe39a2b70ced461968" + ), ); let mut buf = Vec::new(); @@ -65,12 +66,13 @@ fn gost_engine_tests() { } update(h256, h512, &buf[0..539]); check( - h256, h512, + h256, + h512, hex!("c98a17f9fadff78d08521e4179a7b2e6275f3b1da88339a3cb961a3514e5332e"), - hex!(" - d5ad93fbc9ed7abc1cf28d00827a052b40bea74b04c4fd753102c1bcf9f9dad5 - 142887f8a4cceaa0d64a0a8291592413d6adb956b99138a0023e127ff37bdf08 - "), + hex!( + "d5ad93fbc9ed7abc1cf28d00827a052b40bea74b04c4fd753102c1bcf9f9dad5" + "142887f8a4cceaa0d64a0a8291592413d6adb956b99138a0023e127ff37bdf08" + ), ); for _ in 0..4096 { @@ -81,12 +83,13 @@ fn gost_engine_tests() { } update(h256, h512, b"12345\n"); check( - h256, h512, + h256, + h512, hex!("50e935d725d9359e5991b6b7eba8b3539fca03584d26adf4c827c982ffd49367"), - hex!(" - 1d93645ebfbb477660f98b7d1598e37fbf3bfc8234ead26e2246e1b979e590ac - 46138158a692f9a0c9ac2550758b4d0d4c9fb8af5e595a16d3760c6516443f82 - "), + hex!( + "1d93645ebfbb477660f98b7d1598e37fbf3bfc8234ead26e2246e1b979e590ac" + "46138158a692f9a0c9ac2550758b4d0d4c9fb8af5e595a16d3760c6516443f82" + ), ); } @@ -95,21 +98,21 @@ fn streebog256_rand() { let mut h = Streebog256::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!("eb5783a2d3f1aa52136701c07c90272a45f017733d898cdfc02302ad2ac8ebed")[..], + h.finalize(), + hex!("eb5783a2d3f1aa52136701c07c90272a45f017733d898cdfc02302ad2ac8ebed").into(), ); } #[test] -#[rustfmt::skip] fn streebog512_rand() { let mut h = Streebog512::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - d78479790925e257b1d65bec84cbe9bbd9bf0abcefb9f99aa065cc533187224f - 2bead756c96297dcd17728a838e3117a9123559be655175bf4cdac0ee11fba75 - ")[..], + h.finalize(), + hex!( + "d78479790925e257b1d65bec84cbe9bbd9bf0abcefb9f99aa065cc533187224f" + "2bead756c96297dcd17728a838e3117a9123559be655175bf4cdac0ee11fba75" + ) + .into(), ); } diff --git a/tiger/Cargo.toml b/tiger/Cargo.toml index f2429c5e1..7344af1d6 100644 --- a/tiger/Cargo.toml +++ b/tiger/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "tiger" -version = "0.2.1" +version = "0.3.0" description = "Tiger hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/tiger" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "hash", "tiger", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3" [features] default = ["std"] diff --git a/tiger/README.md b/tiger/README.md index 74ea514e0..3bd01995e 100644 --- a/tiger/README.md +++ b/tiger/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [Tiger] hash function. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -44,7 +44,7 @@ for inclusion in the work by you, as defined in the Apache-2.0 license, without [docs-image]: https://docs.rs/tiger/badge.svg [docs-link]: https://docs.rs/tiger/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/tiger/badge.svg?branch=master diff --git a/tiger/src/lib.rs b/tiger/src/lib.rs index a5f1f8d80..ed2830a7d 100644 --- a/tiger/src/lib.rs +++ b/tiger/src/lib.rs @@ -91,7 +91,7 @@ impl UpdateCore for TigerCore { impl FixedOutputCore for TigerCore { #[inline] fn finalize_fixed_core(&mut self, buffer: &mut Buffer, out: &mut Output) { - let bs = Self::BlockSize::U64 as u64; + let bs = Self::BlockSize::U64; let pos = buffer.get_pos() as u64; let bit_len = 8 * (pos + bs * self.block_len); @@ -165,7 +165,7 @@ impl UpdateCore for Tiger2Core { impl FixedOutputCore for Tiger2Core { #[inline] fn finalize_fixed_core(&mut self, buffer: &mut Buffer, out: &mut Output) { - let bs = Self::BlockSize::U64 as u64; + let bs = Self::BlockSize::U64; let pos = buffer.get_pos() as u64; let bit_len = 8 * (pos + bs * self.block_len); diff --git a/whirlpool/Cargo.toml b/whirlpool/Cargo.toml index 0a459c617..be720462d 100644 --- a/whirlpool/Cargo.toml +++ b/whirlpool/Cargo.toml @@ -1,25 +1,26 @@ [package] name = "whirlpool" -version = "0.10.4" +version = "0.11.0" description = "Whirlpool hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.57" documentation = "https://docs.rs/whirlpool" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "whirlpool", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.3" +digest = "0.11.0-pre" [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] whirlpool-asm = { version = "0.6", optional = true} [dev-dependencies] -digest = { version = "0.10.3", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "0.11.0-pre", features = ["dev"] } +hex-literal = "0.3.3" [features] default = ["std"] diff --git a/whirlpool/README.md b/whirlpool/README.md index e4dfc28f9..6652fa1f0 100644 --- a/whirlpool/README.md +++ b/whirlpool/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [Whirlpool hash function][1]. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.57** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -45,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/whirlpool/badge.svg [docs-link]: https://docs.rs/whirlpool/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes [build-image]: https://github.com/RustCrypto/hashes/workflows/whirlpool/badge.svg?branch=master diff --git a/whirlpool/tests/mod.rs b/whirlpool/tests/mod.rs index 491348ed0..46aa7ff37 100644 --- a/whirlpool/tests/mod.rs +++ b/whirlpool/tests/mod.rs @@ -5,15 +5,15 @@ use whirlpool::{Digest, Whirlpool}; digest::new_test!(whirlpool_main, "whirlpool", Whirlpool, fixed_reset_test); #[test] -#[rustfmt::skip] fn whirlpool_rand() { let mut h = Whirlpool::new(); feed_rand_16mib(&mut h); assert_eq!( - h.finalize()[..], - hex!(" - 8db0acd78686f8160203b53bfb0c0c1ee2332b856732a311f7de8e4ea4c100cc - dd5267e8b63207e644c96d2ef5cfbb53f2519af1904c48fd2ecf937541998b11 - ")[..] + h.finalize(), + hex!( + "8db0acd78686f8160203b53bfb0c0c1ee2332b856732a311f7de8e4ea4c100cc" + "dd5267e8b63207e644c96d2ef5cfbb53f2519af1904c48fd2ecf937541998b11" + ) + .into(), ); }