diff --git a/.github/workflows/ascon-hash.yml b/.github/workflows/ascon-hash.yml index ef41d84b0..a23198ad0 100644 --- a/.github/workflows/ascon-hash.yml +++ b/.github/workflows/ascon-hash.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.56.0 + msrv: 1.71.0 build: needs: set-msrv @@ -42,9 +42,6 @@ jobs: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} - uses: RustCrypto/actions/cargo-hack-install@master - # TODO: remove after bump to MSRV 1.60+ - - run: cargo update - - run: cargo update -p zeroize --precise 1.6.0 - run: cargo hack build --target ${{ matrix.target }} --each-feature --exclude-features default,std minimal-versions: @@ -67,7 +64,4 @@ jobs: with: toolchain: ${{ matrix.rust }} - uses: RustCrypto/actions/cargo-hack-install@master - # TODO: remove after bump to MSRV 1.60+ - - run: cargo update - - run: cargo update -p zeroize --precise 1.6.0 - run: cargo hack test --feature-powerset diff --git a/.github/workflows/belt-hash.yml b/.github/workflows/belt-hash.yml index 86fcd7fae..173161990 100644 --- a/.github/workflows/belt-hash.yml +++ b/.github/workflows/belt-hash.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/blake2.yml b/.github/workflows/blake2.yml index bac43c034..725e8838c 100644 --- a/.github/workflows/blake2.yml +++ b/.github/workflows/blake2.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.71.0 build: needs: set-msrv @@ -68,24 +68,25 @@ jobs: working-directory: ${{ github.workflow }} stable-cmd: cargo hack test --release --feature-powerset --exclude-features simd,simd_opt,simd_asm - simd: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2021-05-01 - - run: cargo test --features simd - - run: cargo test --features simd_opt - - run: cargo test --features simd_asm +# No longer builds on recent nightlies +# simd: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: RustCrypto/actions/cargo-cache@master +# - uses: dtolnay/rust-toolchain@master +# with: +# toolchain: nightly-2021-05-01 +# - run: cargo test --features simd +# - run: cargo test --features simd_opt +# - run: cargo test --features simd_asm # Cross-compiled tests cross: strategy: matrix: rust: - - 1.51 # 1.41-1.50 `--features` can't be used inside virtual manifest + - 1.71.0 - stable target: - aarch64-unknown-linux-gnu diff --git a/.github/workflows/fsb.yml b/.github/workflows/fsb.yml index 5fa5fdb1b..1156dc584 100644 --- a/.github/workflows/fsb.yml +++ b/.github/workflows/fsb.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/gost94.yml b/.github/workflows/gost94.yml index 8da43ab24..fe95c984a 100644 --- a/.github/workflows/gost94.yml +++ b/.github/workflows/gost94.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv @@ -65,19 +65,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # 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@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo test - - run: cargo test --no-default-features diff --git a/.github/workflows/groestl.yml b/.github/workflows/groestl.yml index 6bcd030d7..0d75d8e2b 100644 --- a/.github/workflows/groestl.yml +++ b/.github/workflows/groestl.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/jh.yml b/.github/workflows/jh.yml index 6000c3efe..8b583b874 100644 --- a/.github/workflows/jh.yml +++ b/.github/workflows/jh.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/k12.yml b/.github/workflows/k12.yml index 569567ed2..3e52e7acf 100644 --- a/.github/workflows/k12.yml +++ b/.github/workflows/k12.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.56.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/md2.yml b/.github/workflows/md2.yml index d721cfdcc..7fae45cde 100644 --- a/.github/workflows/md2.yml +++ b/.github/workflows/md2.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv @@ -65,19 +65,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # 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@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/md4.yml b/.github/workflows/md4.yml index 08af3f065..55761a647 100644 --- a/.github/workflows/md4.yml +++ b/.github/workflows/md4.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv @@ -65,19 +65,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.41.0 # MSRV - steps: - - uses: actions/checkout@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/md5.yml b/.github/workflows/md5.yml index a1d2ce88d..fec0dcf71 100644 --- a/.github/workflows/md5.yml +++ b/.github/workflows/md5.yml @@ -24,7 +24,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv @@ -80,18 +80,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.41.0 # MSRV - steps: - - uses: actions/checkout@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo test diff --git a/.github/workflows/ripemd.yml b/.github/workflows/ripemd.yml index 84294eb38..1327ce1da 100644 --- a/.github/workflows/ripemd.yml +++ b/.github/workflows/ripemd.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv @@ -66,18 +66,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # TODO: merge with test on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - strategy: - matrix: - rust: - - 1.41.0 # MSRV - steps: - - uses: actions/checkout@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo test --no-default-features diff --git a/.github/workflows/sha1.yml b/.github/workflows/sha1.yml index e9ae90cbc..e1c18388a 100644 --- a/.github/workflows/sha1.yml +++ b/.github/workflows/sha1.yml @@ -21,9 +21,7 @@ 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 + msrv: 1.71.0 # Builds for no_std platforms build: @@ -115,11 +113,10 @@ jobs: matrix: include: # 64-bit Windows (GNU) - # TODO(tarcieri): try re-enabling this when we bump MSRV - #- target: x86_64-pc-windows-gnu - # toolchain: ${{needs.set-msrv.outputs.msrv}} - target: x86_64-pc-windows-gnu - rust: stable + toolchain: ${{needs.set-msrv.outputs.msrv}} + - target: x86_64-pc-windows-gnu + toolchain: stable runs-on: windows-latest steps: @@ -127,7 +124,7 @@ jobs: - uses: RustCrypto/actions/cargo-cache@master - uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.rust }} + toolchain: ${{ matrix.toolchain }} targets: ${{ matrix.target }} - uses: msys2/setup-msys2@v2 - run: cargo test --target ${{ matrix.target }} @@ -149,7 +146,7 @@ jobs: strategy: matrix: rust: - - 1.51.0 # 1.41-1.50 `--features` can't be used inside virtual manifest + - 1.71.0 - stable target: - aarch64-unknown-linux-gnu @@ -176,15 +173,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@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.41.0 - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/sha2.yml b/.github/workflows/sha2.yml index 1ce8ac3ae..577a88662 100644 --- a/.github/workflows/sha2.yml +++ b/.github/workflows/sha2.yml @@ -21,9 +21,7 @@ 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.59.0 + msrv: 1.71.0 # Builds for no_std platforms build: @@ -32,7 +30,7 @@ jobs: strategy: matrix: rust: - - 1.59 + - 1.71.0 - stable target: - thumbv7em-none-eabi @@ -168,15 +166,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # TODO: remove on MSRV bump to 1.57 or higher - test-msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.41.0 - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/sha3.yml b/.github/workflows/sha3.yml index ae0ea4088..12183917e 100644 --- a/.github/workflows/sha3.yml +++ b/.github/workflows/sha3.yml @@ -21,9 +21,7 @@ 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 + msrv: 1.71.0 build: needs: set-msrv @@ -95,15 +93,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@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - with: - toolchain: 1.41.0 - - run: cargo test --no-default-features - - run: cargo test diff --git a/.github/workflows/shabal.yml b/.github/workflows/shabal.yml index fe8236b85..dc14fde77 100644 --- a/.github/workflows/shabal.yml +++ b/.github/workflows/shabal.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/skein.yml b/.github/workflows/skein.yml index e66d8de18..7374fa6b0 100644 --- a/.github/workflows/skein.yml +++ b/.github/workflows/skein.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/sm3.yml b/.github/workflows/sm3.yml index 633126e1f..2ae8c32db 100644 --- a/.github/workflows/sm3.yml +++ b/.github/workflows/sm3.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/streebog.yml b/.github/workflows/streebog.yml index 6d18449bd..c52d42c87 100644 --- a/.github/workflows/streebog.yml +++ b/.github/workflows/streebog.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.57.0 + msrv: 1.71.0 build: needs: set-msrv @@ -65,17 +65,3 @@ jobs: uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} - - # `oid` feature bumps MSRV to 1.57, so we temporarily split this job. - test-msrv: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: RustCrypto/actions/cargo-cache@master - - uses: dtolnay/rust-toolchain@master - 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 38371a4da..43a7334fa 100644 --- a/.github/workflows/tiger.yml +++ b/.github/workflows/tiger.yml @@ -24,7 +24,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.56.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/.github/workflows/whirlpool.yml b/.github/workflows/whirlpool.yml index c797d3ffd..5e360c6ba 100644 --- a/.github/workflows/whirlpool.yml +++ b/.github/workflows/whirlpool.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.71.0 build: needs: set-msrv diff --git a/Cargo.lock b/Cargo.lock index ca5e1d309..e3ff9b658 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,9 +2,43 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ascon" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e716048a18530cce4684daf98a7563a499d710e1ed8ef35567fcb43a7c5f1" +dependencies = [ + "zeroize", +] + +[[package]] +name = "ascon-hash" +version = "0.3.0-pre" +dependencies = [ + "ascon", + "digest", + "hex", + "spectral", +] + +[[package]] +name = "belt-block" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9aa1eef3994e2ccd304a78fe3fea4a73e5792007f85f09b79bb82143ca5f82b" + +[[package]] +name = "belt-hash" +version = "0.2.0-pre" +dependencies = [ + "belt-block", + "digest", + "hex-literal", +] + [[package]] name = "blake2" -version = "0.10.6" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", @@ -18,11 +52,11 @@ checksum = "847495c209977a90e8aad588b959d0ca9f5dc228096d29a6bd3defd53f35eaec" [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.11.0-pre.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "72bc448e41b30773616b4f51a23f1a51634d41ce0d06a9bf6c3065ee85e227a1" dependencies = [ - "generic-array", + "crypto-common", ] [[package]] @@ -42,9 +76,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "const-oid" -version = "0.9.5" +version = "0.10.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "f7e3352a27098ba6b09546e5f13b15165e6a88b5c2723afecb3ea9576b27e3ea" [[package]] name = "cpufeatures" @@ -57,19 +91,20 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.2.0-pre.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "cc17eb697364b18256ec92675ebe6b7b153d2f1041e568d74533c5d0fc1ca162" dependencies = [ - "generic-array", - "typenum", + "getrandom", + "hybrid-array", + "rand_core", ] [[package]] name = "digest" -version = "0.10.7" +version = "0.11.0-pre.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "eb3be3c52e023de5662dc05a32f747d09a1d6024fdd1f64b0850e373269efb43" dependencies = [ "blobby", "block-buffer", @@ -80,7 +115,7 @@ dependencies = [ [[package]] name = "fsb" -version = "0.1.3" +version = "0.2.0-pre" dependencies = [ "digest", "hex-literal", @@ -88,18 +123,19 @@ dependencies = [ ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "getrandom" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ - "typenum", - "version_check", + "cfg-if", + "libc", + "wasi", ] [[package]] name = "gost94" -version = "0.10.4" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", @@ -107,29 +143,49 @@ dependencies = [ [[package]] name = "groestl" -version = "0.10.1" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hex-literal" -version = "0.2.2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hybrid-array" +version = "0.2.0-pre.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70693199b3cf4552f3fa720b54163927a3ebed2aef240efaf556033ab336a11" +checksum = "27fbaf242418fe980caf09ed348d5a6aeabe71fc1bd8bebad641f4591ae0a46d" dependencies = [ - "hex-literal-impl", - "proc-macro-hack", + "typenum", ] [[package]] -name = "hex-literal-impl" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59448fc2f82a5fb6907f78c3d69d843e82ff5b051923313cc4438cb0c7b745a8" +name = "jh" +version = "0.2.0-pre" +dependencies = [ + "digest", + "hex-literal", + "ppv-lite86", +] + +[[package]] +name = "k12" +version = "0.4.0-pre" dependencies = [ - "proc-macro-hack", + "digest", + "hex-literal", + "sha3", ] [[package]] @@ -149,7 +205,7 @@ checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "md-5" -version = "0.10.6" +version = "0.11.0-pre" dependencies = [ "cfg-if", "digest", @@ -159,7 +215,7 @@ dependencies = [ [[package]] name = "md2" -version = "0.10.2" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", @@ -167,7 +223,7 @@ dependencies = [ [[package]] name = "md4" -version = "0.10.2" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", @@ -183,14 +239,23 @@ dependencies = [ ] [[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] [[package]] name = "ripemd" -version = "0.1.3" +version = "0.2.0-pre" dependencies = [ "digest", "hex-literal", @@ -198,7 +263,7 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.11.0-pre" dependencies = [ "cfg-if", "cpufeatures", @@ -218,7 +283,7 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.11.0-pre" dependencies = [ "cfg-if", "cpufeatures", @@ -238,7 +303,7 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.8" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", @@ -248,23 +313,38 @@ dependencies = [ [[package]] name = "shabal" -version = "0.4.1" +version = "0.5.0-pre" +dependencies = [ + "digest", + "hex-literal", +] + +[[package]] +name = "skein" +version = "0.2.0-pre" dependencies = [ "digest", "hex-literal", + "threefish", ] [[package]] name = "sm3" -version = "0.4.2" +version = "0.5.0-pre" dependencies = [ "digest", "hex-literal", ] +[[package]] +name = "spectral" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3c15181f4b14e52eeaac3efaeec4d2764716ce9c86da0c934c3e318649c5ba" + [[package]] name = "streebog" -version = "0.10.2" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", @@ -276,9 +356,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "threefish" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a693d0c8cf16973fac5a93fbe47b8c6452e7097d4fcac49f3d7a18e39c76e62e" + [[package]] name = "tiger" -version = "0.2.1" +version = "0.3.0-pre" dependencies = [ "digest", "hex-literal", @@ -291,14 +377,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] -name = "version_check" -version = "0.9.4" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "whirlpool" -version = "0.10.4" +version = "0.11.0-pre" dependencies = [ "digest", "hex-literal", diff --git a/Cargo.toml b/Cargo.toml index 790a09c7f..26637761e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,14 @@ [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 = [ + "ascon-hash", + "belt-hash", "blake2", "fsb", "gost94", "groestl", + "jh", + "k12", "md2", "md4", "md5", @@ -15,18 +17,12 @@ members = [ "sha2", "sha3", "shabal", + "skein", "sm3", "streebog", "tiger", "whirlpool", ] -exclude = [ - "ascon-hash", - "belt-hash", - "jh", - "k12", - "skein", -] [profile.dev] opt-level = 2 diff --git a/README.md b/README.md index 8603430be..3e4c81dbc 100644 --- a/README.md +++ b/README.md @@ -13,27 +13,27 @@ Additionally all crates do not require the standard library (i.e. `no_std` capab | Algorithm | Crate | Crates.io | Documentation | MSRV | [Security] | |-----------|-------|:---------:|:-------------:|:----:|:----------:| -| [Ascon] hash | [`ascon‑hash`] | [![crates.io](https://img.shields.io/crates/v/ascon-hash.svg)](https://crates.io/crates/ascon-hash) | [![Documentation](https://docs.rs/ascon-hash/badge.svg)](https://docs.rs/ascon-hash) | ![MSRV 1.56][msrv-1.56] | :green_heart: | -| [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: | -| [JH] | [`jh`] | [![crates.io](https://img.shields.io/crates/v/jh.svg)](https://crates.io/crates/jh) | [![Documentation](https://docs.rs/jh/badge.svg)](https://docs.rs/jh) | ![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.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: | -| [Skein] | [`skein`] | [![crates.io](https://img.shields.io/crates/v/skein.svg)](https://crates.io/crates/skein) | [![Documentation](https://docs.rs/skein/badge.svg)](https://docs.rs/skein) | ![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.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: | +| [Ascon] hash | [`ascon‑hash`] | [![crates.io](https://img.shields.io/crates/v/ascon-hash.svg)](https://crates.io/crates/ascon-hash) | [![Documentation](https://docs.rs/ascon-hash/badge.svg)](https://docs.rs/ascon-hash) | ![MSRV 1.65][msrv-1.65] | :green_heart: | +| [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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :green_heart: | +| [JH] | [`jh`] | [![crates.io](https://img.shields.io/crates/v/jh.svg)](https://crates.io/crates/jh) | [![Documentation](https://docs.rs/jh/badge.svg)](https://docs.rs/jh) | ![MSRV 1.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :green_heart: | +| [Skein] | [`skein`] | [![crates.io](https://img.shields.io/crates/v/skein.svg)](https://crates.io/crates/skein) | [![Documentation](https://docs.rs/skein/badge.svg)](https://docs.rs/skein) | ![MSRV 1.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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.65][msrv-1.65] | :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. @@ -233,9 +233,7 @@ 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.56]: https://img.shields.io/badge/rustc-1.56.0+-blue.svg -[msrv-1.57]: https://img.shields.io/badge/rustc-1.57.0+-blue.svg +[msrv-1.65]: https://img.shields.io/badge/rustc-1.65.0+-blue.svg [//]: # (crates) diff --git a/ascon-hash/Cargo.toml b/ascon-hash/Cargo.toml index cb3707cc7..58575d87e 100644 --- a/ascon-hash/Cargo.toml +++ b/ascon-hash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ascon-hash" -version = "0.2.0" +version = "0.3.0-pre" description = "Implementation of the Ascon and AsconA hashes and XOFs" authors = [ "Sebastian Ramacher ", @@ -13,12 +13,10 @@ documentation = "https://docs.rs/ascon-hash" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "hash", "ascon"] categories = ["cryptography", "no-std"] -rust-version = "1.56" - -[workspace] +rust-version = "1.71" [dependencies] -digest = { version = "0.10", default-features = false, features = ["core-api"] } +digest = { version = "=0.11.0-pre.3", default-features = false, features = ["core-api"] } ascon = { version = "0.4", default-features = false } [dev-dependencies] diff --git a/ascon-hash/README.md b/ascon-hash/README.md index e26b878f0..33f24c326 100644 --- a/ascon-hash/README.md +++ b/ascon-hash/README.md @@ -2,10 +2,10 @@ [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] +[![Build Status][build-image]][build-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] -[![Build Status][build-image]][build-link] Pure Rust implementation of the lightweight cryptographic hash functions [AsconHash and AsconAHash][1] and the extendable output functions (XOF) AsconXOF @@ -21,7 +21,7 @@ USE AT YOUR OWN RISK! ## Minimum Supported Rust Version -This crate requires **Rust 1.56** at a minimum. +This crate requires **Rust 1.65** at a minimum. We may change the MSRV in the future, but it will be accompanied by a minor version bump. @@ -48,7 +48,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/ascon-hash/badge.svg [docs-link]: https://docs.rs/ascon-hash/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.65+-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/ascon-hash/badge.svg?branch=master diff --git a/belt-hash/Cargo.toml b/belt-hash/Cargo.toml index a104a1810..05d0726e0 100644 --- a/belt-hash/Cargo.toml +++ b/belt-hash/Cargo.toml @@ -1,30 +1,26 @@ [package] name = "belt-hash" -version = "0.1.1" +version = "0.2.0-pre" description = "BelT hash function (STB 34.101.31-2020)" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" edition = "2021" -rust-version = "1.57" +rust-version = "1.71" documentation = "https://docs.rs/belt-hash" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "belt", "stb", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10.4" +digest = "=0.11.0-pre.3" belt-block = { version = "0.1.1", default-features = false } [dev-dependencies] -digest = { version = "0.10.4", features = ["dev"] } -hex-literal = "0.3.3" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] std = ["digest/std"] oid = ["digest/oid"] - -# TODO: remove when crate will be part of the root workspace -[profile.dev] -opt-level = 2 diff --git a/belt-hash/README.md b/belt-hash/README.md index b9b03a24a..f515ceaa1 100644 --- a/belt-hash/README.md +++ b/belt-hash/README.md @@ -2,10 +2,10 @@ [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] +[![Build Status][build-image]][build-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] -[![Build Status][build-image]][build-link] Pure Rust implementation of the [BelT] hash function specified in [STB 34.101.31-2020]. @@ -13,7 +13,7 @@ Pure Rust implementation of the [BelT] hash function specified in [STB 34.101.31 ## Minimum Supported Rust Version -Rust **1.57** or higher. +Rust **1.65** 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/belt-hash/badge.svg [docs-link]: https://docs.rs/belt-hash [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.65+-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/belt-hash/badge.svg?branch=master diff --git a/belt-hash/src/lib.rs b/belt-hash/src/lib.rs index 29b9fbad8..e92dfc6bb 100644 --- a/belt-hash/src/lib.rs +++ b/belt-hash/src/lib.rs @@ -13,7 +13,7 @@ //! // process input message //! hasher.update(b"hello world"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 32] //! let result = hasher.finalize(); //! let expected = hex!( @@ -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/benches/Cargo.toml b/benches/Cargo.toml index 26e57ce6c..d57094bbc 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -5,7 +5,7 @@ authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" description = "Criterion benchmarks of the hash crates" edition = "2021" -rust-version = "1.59" +rust-version = "1.71" publish = false [workspace] diff --git a/blake2/Cargo.toml b/blake2/Cargo.toml index adb06e061..cd132e7a5 100644 --- a/blake2/Cargo.toml +++ b/blake2/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "blake2" -version = "0.10.6" +version = "0.11.0-pre" description = "BLAKE2 hash functions" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/blake2" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "blake2", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = { version = "0.10.7", features = ["mac"] } +digest = { version = "=0.11.0-pre.3", features = ["mac"] } [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/blake2/README.md b/blake2/README.md index 913b729e9..1575ab8bb 100644 --- a/blake2/README.md +++ b/blake2/README.md @@ -2,10 +2,10 @@ [![crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] +[![Build Status][build-image]][build-link] ![Apache2/MIT licensed][license-image] ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] -[![Build Status][build-image]][build-link] Pure Rust implementation of the [BLAKE2 hash function][1] family. @@ -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.65** 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.65+-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/lib.rs b/blake2/src/lib.rs index 85a6b1c28..a18d448ea 100644 --- a/blake2/src/lib.rs +++ b/blake2/src/lib.rs @@ -84,6 +84,7 @@ pub use digest::{self, Digest}; use core::{convert::TryInto, fmt, marker::PhantomData, ops::Div}; use digest::{ + array::{Array, ArraySize}, block_buffer::{Lazy, LazyBuffer}, consts::{U128, U32, U4, U64}, core_api::{ @@ -92,7 +93,6 @@ use digest::{ VariableOutputCore, }, crypto_common::{InvalidLength, Key, KeyInit, KeySizeUser}, - generic_array::{ArrayLength, GenericArray}, typenum::{IsLessOrEqual, LeEq, NonZero, Unsigned}, FixedOutput, HashMarker, InvalidOutputSize, MacMarker, Output, Update, }; diff --git a/blake2/src/macros.rs b/blake2/src/macros.rs index 917a212c8..bf92d5039 100644 --- a/blake2/src/macros.rs +++ b/blake2/src/macros.rs @@ -44,8 +44,7 @@ macro_rules! blake2_impl { // salt is two words long if salt.len() < length { - let mut padded_salt = - GenericArray::>::Output>::default(); + let mut padded_salt = Array::>::Output>::default(); for i in 0..salt.len() { padded_salt[i] = salt[i]; } @@ -63,8 +62,7 @@ macro_rules! blake2_impl { // persona is also two words long if persona.len() < length { - let mut padded_persona = - GenericArray::>::Output>::default(); + let mut padded_persona = Array::>::Output>::default(); for i in 0..persona.len() { padded_persona[i] = persona[i]; } @@ -95,7 +93,7 @@ macro_rules! blake2_impl { fn finalize_with_flag( &mut self, - final_block: &GenericArray, + final_block: &Array, flag: $word, out: &mut Output, ) { @@ -224,7 +222,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); } } @@ -259,7 +257,7 @@ macro_rules! blake2_mac_impl { #[doc=$doc] pub struct $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { core: $hash, @@ -271,7 +269,7 @@ macro_rules! blake2_mac_impl { impl $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { /// Create new instance using provided key, salt, and persona. @@ -309,7 +307,7 @@ macro_rules! blake2_mac_impl { impl KeySizeUser for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { type KeySize = $max_size; @@ -317,7 +315,7 @@ macro_rules! blake2_mac_impl { impl KeyInit for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { #[inline] @@ -349,7 +347,7 @@ macro_rules! blake2_mac_impl { impl Update for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { #[inline] @@ -361,7 +359,7 @@ macro_rules! blake2_mac_impl { impl OutputSizeUser for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size> + 'static, + OutSize: ArraySize + IsLessOrEqual<$max_size> + 'static, LeEq: NonZero, { type OutputSize = OutSize; @@ -369,7 +367,7 @@ macro_rules! blake2_mac_impl { impl FixedOutput for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size> + 'static, + OutSize: ArraySize + IsLessOrEqual<$max_size> + 'static, LeEq: NonZero, { #[inline] @@ -384,7 +382,7 @@ macro_rules! blake2_mac_impl { #[cfg(feature = "reset")] impl Reset for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { fn reset(&mut self) { @@ -399,7 +397,7 @@ macro_rules! blake2_mac_impl { #[cfg(feature = "reset")] impl FixedOutputReset for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { #[inline] @@ -414,14 +412,14 @@ macro_rules! blake2_mac_impl { impl MacMarker for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { } impl fmt::Debug for $name where - OutSize: ArrayLength + IsLessOrEqual<$max_size>, + OutSize: ArraySize + IsLessOrEqual<$max_size>, LeEq: NonZero, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/blake2/tests/mac.rs b/blake2/tests/mac.rs index dd75a5703..44c3244f3 100644 --- a/blake2/tests/mac.rs +++ b/blake2/tests/mac.rs @@ -8,15 +8,15 @@ new_test!(blake2s_mac, "blake2s/mac", blake2::Blake2sMac256); #[test] fn blake2b_new_test() { - use blake2::digest::{generic_array::GenericArray, KeyInit, Mac}; + use blake2::digest::{array::Array, KeyInit, Mac}; fn run(key: &[u8]) { const DATA: &[u8] = &[42; 300]; - let res1 = ::new(GenericArray::from_slice(key)) + let res1 = T::new(Array::ref_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/fsb/Cargo.toml b/fsb/Cargo.toml index 399cd970d..800e03e1c 100644 --- a/fsb/Cargo.toml +++ b/fsb/Cargo.toml @@ -1,23 +1,24 @@ [package] name = "fsb" -version = "0.1.3" +version = "0.2.0-pre" description = "FSB hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/fsb" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "fsb", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" -whirlpool = { version = "0.10.1", path = "../whirlpool", default-features = false } +digest = "=0.11.0-pre.3" +whirlpool = { version = "=0.11.0-pre", path = "../whirlpool", default-features = false } [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/fsb/README.md b/fsb/README.md index bff04069c..09bbf3625 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.65** 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.47+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.65+-blue.svg [build-image]: https://github.com/RustCrypto/hashes/workflows/fsb/badge.svg?branch=master [build-link]: https://github.com/RustCrypto/hashes/actions?query=workflow%3Afsb diff --git a/gost94/Cargo.toml b/gost94/Cargo.toml index 7fa75ab7f..3657063b9 100644 --- a/gost94/Cargo.toml +++ b/gost94/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "gost94" -version = "0.10.4" +version = "0.11.0-pre" description = "GOST R 34.11-94 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/gost94" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "gost94", "gost", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/gost94/src/lib.rs b/gost94/src/lib.rs index 1a55faa1e..f530a1bcc 100644 --- a/gost94/src/lib.rs +++ b/gost94/src/lib.rs @@ -11,7 +11,7 @@ //! // process input message //! hasher.update("The quick brown fox jumps over the lazy dog"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 32] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!(" diff --git a/groestl/Cargo.toml b/groestl/Cargo.toml index 87915c734..c86567772 100644 --- a/groestl/Cargo.toml +++ b/groestl/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "groestl" -version = "0.10.1" +version = "0.11.0-pre" description = "Grøstl hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/groestl" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "groestl", "grostl", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/groestl/src/lib.rs b/groestl/src/lib.rs index fce249751..730477f3d 100644 --- a/groestl/src/lib.rs +++ b/groestl/src/lib.rs @@ -12,7 +12,7 @@ //! // process input message //! hasher.update(b"my message"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 32] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!(" diff --git a/jh/Cargo.toml b/jh/Cargo.toml index 28e8f539d..4251bfda4 100644 --- a/jh/Cargo.toml +++ b/jh/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "jh" -version = "0.1.0" +version = "0.2.0-pre" description = "Pure Rust implementation of the JH cryptographic hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.57" +rust-version = "1.71" readme = "README.md" documentation = "https://docs.rs/jh" repository = "https://github.com/RustCrypto/hashes" @@ -13,9 +13,9 @@ keywords = ["crypto", "jh", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10" +digest = "=0.11.0-pre.3" hex-literal = "0.4" simd = { package = "ppv-lite86", version = "0.2.6" } [dev-dependencies] -digest = { version = "0.10", features = ["dev"] } +digest = { version = "=0.11.0-pre.3", features = ["dev"] } diff --git a/jh/src/compressor.rs b/jh/src/compressor.rs index f75cde8a0..a1b2ea2ac 100644 --- a/jh/src/compressor.rs +++ b/jh/src/compressor.rs @@ -1,7 +1,7 @@ #![allow(non_upper_case_globals)] use core::ptr; -use digest::generic_array::{typenum::U64, GenericArray}; +use digest::array::{typenum::U64, Array}; use simd::{dispatch, vec128_storage, AndNot, Machine, Swap64, VZip, Vec2}; #[rustfmt::skip] @@ -167,7 +167,7 @@ impl Compressor { } #[inline] - pub(crate) fn update(&mut self, data: &GenericArray) { + pub(crate) fn update(&mut self, data: &Array) { f8(unsafe { &mut self.cv }, data.as_ptr()); } diff --git a/jh/src/lib.rs b/jh/src/lib.rs index 9dcea8940..93e6e891b 100644 --- a/jh/src/lib.rs +++ b/jh/src/lib.rs @@ -49,13 +49,13 @@ pub use digest::{self, Digest}; use crate::compressor::Compressor; use core::fmt; use digest::{ + array::typenum::{Unsigned, U28, U32, U48, U64}, block_buffer::Eager, core_api::{ AlgorithmName, Block, Buffer, BufferKindUser, CoreWrapper, CtVariableCoreWrapper, TruncSide, UpdateCore, VariableOutputCore, }, crypto_common::{BlockSizeUser, OutputSizeUser}, - generic_array::typenum::{Unsigned, U28, U32, U48, U64}, HashMarker, InvalidOutputSize, Output, }; diff --git a/k12/Cargo.toml b/k12/Cargo.toml index f0679ea53..2af9e79d8 100644 --- a/k12/Cargo.toml +++ b/k12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "k12" -version = "0.3.0" +version = "0.4.0-pre" description = "Pure Rust implementation of the KangarooTwelve hash function" authors = ["RustCrypto Developers", "Diggory Hardy "] license = "Apache-2.0 OR MIT" @@ -10,20 +10,16 @@ documentation = "https://docs.rs/k12" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "hash", "digest"] categories = ["cryptography", "no-std"] -rust-version = "1.56" +rust-version = "1.71" [dependencies] -digest = { version = "0.10.7", default-features = false, features = ["core-api"] } -sha3 = { version = "0.10.8", default-features = false } +digest = { version = "=0.11.0-pre.3", default-features = false, features = ["core-api"] } +sha3 = { version = "=0.11.0-pre", default-features = false, path = "../sha3" } [dev-dependencies] -digest = { version = "0.10.7", features = ["alloc", "dev"] } -hex-literal = "0.3" +digest = { version = "=0.11.0-pre.3", features = ["alloc", "dev"] } +hex-literal = "0.4" [features] default = ["std"] std = ["digest/std"] - -# TODO: remove when crate will be part of the root workspace -[profile.dev] -opt-level = 2 diff --git a/md2/Cargo.toml b/md2/Cargo.toml index 679594a26..3dead49f7 100644 --- a/md2/Cargo.toml +++ b/md2/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "md2" -version = "0.10.2" +version = "0.11.0-pre" license = "MIT OR Apache-2.0" authors = ["RustCrypto Developers"] description = "MD2 hash function" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/md2" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "md2", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/md2/src/lib.rs b/md2/src/lib.rs index 9ab2750b1..7beb7effe 100644 --- a/md2/src/lib.rs +++ b/md2/src/lib.rs @@ -12,7 +12,7 @@ //! // process input message //! hasher.update(b"hello world"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 16] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!("d9cce882ee690a5c1ce70beff3a78c77")); @@ -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 b55aa5fd9..c79370eeb 100644 --- a/md4/Cargo.toml +++ b/md4/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "md4" -version = "0.10.2" +version = "0.11.0-pre" description = "MD4 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/md4" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "md4", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/md4/src/lib.rs b/md4/src/lib.rs index 8ef33aee8..acceb0e32 100644 --- a/md4/src/lib.rs +++ b/md4/src/lib.rs @@ -12,7 +12,7 @@ //! // process input message //! hasher.update(b"hello world"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 16] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!("aa010fbc1d14c795d86ef98c95479d17")); diff --git a/md5/Cargo.toml b/md5/Cargo.toml index 8103cd8a4..1867929bc 100644 --- a/md5/Cargo.toml +++ b/md5/Cargo.toml @@ -1,29 +1,30 @@ [package] name = "md-5" -version = "0.10.6" +version = "0.11.0-pre" description = "MD5 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/md-5" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "md5", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [lib] name = "md5" [dependencies] -digest = "0.10.7" -cfg-if = "1.0" +digest = "=0.11.0-pre.3" +cfg-if = "1" [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] md5-asm = { version = "0.5", optional = true } [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/md5/src/lib.rs b/md5/src/lib.rs index a45de2f11..59f5b84d4 100644 --- a/md5/src/lib.rs +++ b/md5/src/lib.rs @@ -12,7 +12,7 @@ //! // process input message //! hasher.update(b"hello world"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 16] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!("5eb63bbbe01eeed093cb22bb8f5acdc3")); @@ -137,7 +137,7 @@ const BLOCK_SIZE: usize = ::BlockSize::USIZE; #[inline(always)] fn convert(blocks: &[Block]) -> &[[u8; BLOCK_SIZE]] { - // SAFETY: GenericArray and [u8; 64] have + // SAFETY: Array and [u8; 64] have // exactly the same memory layout let p = blocks.as_ptr() as *const [u8; BLOCK_SIZE]; unsafe { core::slice::from_raw_parts(p, blocks.len()) } diff --git a/ripemd/Cargo.toml b/ripemd/Cargo.toml index 88c69aa28..8eb7f9f65 100644 --- a/ripemd/Cargo.toml +++ b/ripemd/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "ripemd" -version = "0.1.3" +version = "0.2.0-pre" 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" documentation = "https://docs.rs/ripemd" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "ripemd", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/ripemd/src/lib.rs b/ripemd/src/lib.rs index 1a28ed76b..5bb19b977 100644 --- a/ripemd/src/lib.rs +++ b/ripemd/src/lib.rs @@ -18,7 +18,7 @@ //! // process input message //! hasher.update(b"Hello world!"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 20] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!("7f772647d88750add82d8e1a7a3e5c0902a346a3")); diff --git a/ripemd/tests/mod.rs b/ripemd/tests/mod.rs index 0dd16b0cf..96d3c0086 100644 --- a/ripemd/tests/mod.rs +++ b/ripemd/tests/mod.rs @@ -18,10 +18,7 @@ fn ripemd128_1mil_a() { for _ in 0..1000 { h.update(&buf[..]); } - assert_eq!( - h.finalize(), - hex!("4a7f5723f954eba1216c9d8f6320431f").into() - ); + assert_eq!(h.finalize(), hex!("4a7f5723f954eba1216c9d8f6320431f")); } #[test] @@ -43,7 +40,7 @@ fn ripemd160_1mil_a() { } assert_eq!( h.finalize(), - hex!("52783243c1697bdbe16d37f97f68f08325dc1528").into() + hex!("52783243c1697bdbe16d37f97f68f08325dc1528") ); } @@ -66,7 +63,7 @@ fn ripemd256_1mil_a() { } assert_eq!( h.finalize(), - hex!("ac953744e10e31514c150d4d8d7b677342e33399788296e43ae4850ce4f97978").into() + hex!("ac953744e10e31514c150d4d8d7b677342e33399788296e43ae4850ce4f97978") ); } @@ -93,7 +90,7 @@ fn ripemd320_1mil_a() { hex!(" bdee37f4371e20646b8b0d862dda16292ae36f40 965e8c8509e63d1dbddecc503e2b63eb9245bb66 - ").into() + ") ); } diff --git a/sha1/Cargo.toml b/sha1/Cargo.toml index 3f4b8d3ff..2e87fb942 100644 --- a/sha1/Cargo.toml +++ b/sha1/Cargo.toml @@ -1,18 +1,19 @@ [package] name = "sha1" -version = "0.10.6" +version = "0.11.0-pre" description = "SHA-1 hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/sha1" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sha1", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" cfg-if = "1.0" [target.'cfg(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64"))'.dependencies] @@ -20,8 +21,8 @@ cpufeatures = "0.2" sha1-asm = { version = "0.5", optional = true } [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/sha1/src/compress.rs b/sha1/src/compress.rs index 6f7e40c41..f2bd14426 100644 --- a/sha1/src/compress.rs +++ b/sha1/src/compress.rs @@ -32,7 +32,7 @@ const BLOCK_SIZE: usize = ::BlockSize::USIZE; /// SHA-1 compression function #[cfg_attr(docsrs, doc(cfg(feature = "compress")))] pub fn compress(state: &mut [u32; 5], blocks: &[Block]) { - // SAFETY: GenericArray and [u8; 64] have + // SAFETY: Array and [u8; 64] have // exactly the same memory layout let blocks: &[[u8; BLOCK_SIZE]] = unsafe { &*(blocks as *const _ as *const [[u8; BLOCK_SIZE]]) }; diff --git a/sha1/src/lib.rs b/sha1/src/lib.rs index 25e867e0f..5ea8de75e 100644 --- a/sha1/src/lib.rs +++ b/sha1/src/lib.rs @@ -33,7 +33,7 @@ //! // process input message //! hasher.update(b"hello world"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 20] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!("2aae6c35c94fcfb415dbe95f408b9ce91ee846ed")); diff --git a/sha2/Cargo.toml b/sha2/Cargo.toml index a3dafeaa2..e2933ff5f 100644 --- a/sha2/Cargo.toml +++ b/sha2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sha2" -version = "0.10.8" +version = "0.11.0-pre" description = """ Pure Rust implementation of the SHA-2 hash function family including SHA-224, SHA-256, SHA-384, and SHA-512. @@ -8,32 +8,31 @@ 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" documentation = "https://docs.rs/sha2" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sha2", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" -cfg-if = "1.0" +digest = "=0.11.0-pre.3" +cfg-if = "1" [target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies] cpufeatures = "0.2" sha2-asm = { version = "0.6.1", optional = true } [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] 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 -# Use assembly backend for LoongArch64 targets -# WARNING: Bumps MSRV to 1.72. This feature SHOULD NOT be enabled by library crates -loongarch64_asm = [] +loongarch64_asm = [] # WARNING: this feature SHOULD NOT be enabled by library crates compress = [] # Expose compress functions force-soft = [] # Force software implementation asm-aarch64 = ["asm"] # DEPRECATED: use `asm` instead diff --git a/sha2/src/sha256.rs b/sha2/src/sha256.rs index 8f8287836..7266137f0 100644 --- a/sha2/src/sha256.rs +++ b/sha2/src/sha256.rs @@ -1,4 +1,4 @@ -use digest::{generic_array::GenericArray, typenum::U64}; +use digest::{array::Array, typenum::U64}; cfg_if::cfg_if! { if #[cfg(feature = "force-soft")] { @@ -31,8 +31,8 @@ cfg_if::cfg_if! { /// This is a low-level "hazmat" API which provides direct access to the core /// functionality of SHA-256. #[cfg_attr(docsrs, doc(cfg(feature = "compress")))] -pub fn compress256(state: &mut [u32; 8], blocks: &[GenericArray]) { - // SAFETY: GenericArray and [u8; 64] have +pub fn compress256(state: &mut [u32; 8], blocks: &[Array]) { + // SAFETY: Array and [u8; 64] have // exactly the same memory layout let p = blocks.as_ptr() as *const [u8; 64]; let blocks = unsafe { core::slice::from_raw_parts(p, blocks.len()) }; diff --git a/sha2/src/sha512.rs b/sha2/src/sha512.rs index dfe0b454f..5c3590cf3 100644 --- a/sha2/src/sha512.rs +++ b/sha2/src/sha512.rs @@ -1,4 +1,4 @@ -use digest::{generic_array::GenericArray, typenum::U128}; +use digest::{array::Array, typenum::U128}; cfg_if::cfg_if! { if #[cfg(feature = "force-soft")] { @@ -33,8 +33,8 @@ cfg_if::cfg_if! { /// This is a low-level "hazmat" API which provides direct access to the core /// functionality of SHA-512. #[cfg_attr(docsrs, doc(cfg(feature = "compress")))] -pub fn compress512(state: &mut [u64; 8], blocks: &[GenericArray]) { - // SAFETY: GenericArray and [u8; 64] have +pub fn compress512(state: &mut [u64; 8], blocks: &[Array]) { + // SAFETY: Array and [u8; 64] have // exactly the same memory layout let p = blocks.as_ptr() as *const [u8; 128]; let blocks = unsafe { core::slice::from_raw_parts(p, blocks.len()) }; diff --git a/sha3/Cargo.toml b/sha3/Cargo.toml index 652630b5d..2e057f0e9 100644 --- a/sha3/Cargo.toml +++ b/sha3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sha3" -version = "0.10.8" +version = "0.11.0-pre" description = """ Pure Rust implementation of SHA-3, a family of Keccak-based hash functions including the SHAKE family of eXtendable-Output Functions (XOFs), as well as @@ -9,20 +9,21 @@ the accelerated variant TurboSHAKE authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/sha3" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sha3", "keccak", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" keccak = "0.1.4" zeroize = { version = "1.6.0", default-features = false, optional=true } # WARNING: Bumps MSRV to 1.56 [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/sha3/src/lib.rs b/sha3/src/lib.rs index 0f87ee580..a7bc26b63 100644 --- a/sha3/src/lib.rs +++ b/sha3/src/lib.rs @@ -72,6 +72,7 @@ use core::fmt; #[cfg(feature = "oid")] use digest::const_oid::{AssociatedOid, ObjectIdentifier}; use digest::{ + array::typenum::Unsigned, block_buffer::Eager, consts::{U104, U136, U144, U168, U200, U28, U32, U48, U64, U72}, core_api::{ @@ -79,7 +80,6 @@ use digest::{ ExtendableOutputCore, FixedOutputCore, OutputSizeUser, Reset, UpdateCore, XofReaderCore, XofReaderCoreWrapper, }, - generic_array::typenum::Unsigned, HashMarker, Output, }; diff --git a/sha3/src/macros.rs b/sha3/src/macros.rs index f26291305..b7e346c32 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(), } @@ -281,12 +281,12 @@ macro_rules! impl_turbo_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] = self.domain_separation; let n = block.len(); block[n - 1] |= 0x80; - self.state.absorb_block(block); + self.state.absorb_block(&block); $reader { state: self.state.clone(), } @@ -424,10 +424,10 @@ macro_rules! impl_cshake { ); buffer.digest_blocks(customization, |blocks| { for block in blocks { - state.absorb_block(block); + state.absorb_block(&block); } }); - state.absorb_block(buffer.pad_with_zeros()); + state.absorb_block(&buffer.pad_with_zeros()); Self { padding: $cshake_pad, @@ -463,12 +463,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 87c0c3905..abc5e4e75 100644 --- a/shabal/Cargo.toml +++ b/shabal/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "shabal" -version = "0.4.1" +version = "0.5.0-pre" description = "Shabal hash functions" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/shabal" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "shabal", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/shabal/src/core_api.rs b/shabal/src/core_api.rs index 561117522..ce5df75df 100644 --- a/shabal/src/core_api.rs +++ b/shabal/src/core_api.rs @@ -1,18 +1,18 @@ use crate::consts; use core::{convert::TryInto, fmt, mem, num::Wrapping}; use digest::{ + array::Array, block_buffer::Eager, consts::U64, core_api::{ AlgorithmName, BlockSizeUser, Buffer, BufferKindUser, OutputSizeUser, TruncSide, UpdateCore, VariableOutputCore, }, - generic_array::GenericArray, HashMarker, InvalidOutputSize, Output, }; type BlockSize = U64; -type Block = GenericArray; +type Block = Array; type M = [Wrapping; 16]; /// Inner state of Shabal hash functions. @@ -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/src/lib.rs b/shabal/src/lib.rs index 9329692bd..bb529aa4b 100644 --- a/shabal/src/lib.rs +++ b/shabal/src/lib.rs @@ -23,7 +23,7 @@ //! // process input message //! hasher.update(b"helloworld"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 32] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!(" diff --git a/skein/Cargo.toml b/skein/Cargo.toml index 5f1d59871..538df58f9 100644 --- a/skein/Cargo.toml +++ b/skein/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "skein" -version = "0.1.0" +version = "0.2.0-pre" description = "Skein hash functions" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.57" +rust-version = "1.71" readme = "README.md" documentation = "https://docs.rs/skein" repository = "https://github.com/RustCrypto/hashes" @@ -13,9 +13,9 @@ keywords = ["crypto", "skein", "hash", "digest"] categories = ["cryptography", "no-std"] [dependencies] -digest = "0.10" +digest = "=0.11.0-pre.3" threefish = { version = "0.5.2", default-features = false } [dev-dependencies] -digest = { version = "0.10", features = ["dev"] } +digest = { version = "=0.11.0-pre.3", features = ["dev"] } hex-literal = "0.4" diff --git a/skein/benches/skein1024.rs b/skein/benches/skein1024.rs index 2101cdb34..bb9881978 100644 --- a/skein/benches/skein1024.rs +++ b/skein/benches/skein1024.rs @@ -1,7 +1,7 @@ #![feature(test)] extern crate test; -use digest::{bench_update, generic_array::typenum::U128}; +use digest::{array::typenum::U128, bench_update}; use skein::Skein1024; use test::Bencher; diff --git a/skein/benches/skein256.rs b/skein/benches/skein256.rs index c2646fc79..8b56987f5 100644 --- a/skein/benches/skein256.rs +++ b/skein/benches/skein256.rs @@ -1,7 +1,7 @@ #![feature(test)] extern crate test; -use digest::{bench_update, generic_array::typenum::U32}; +use digest::{array::typenum::U32, bench_update}; use skein::Skein256; use test::Bencher; diff --git a/skein/benches/skein512.rs b/skein/benches/skein512.rs index 727db6989..c0183de8c 100644 --- a/skein/benches/skein512.rs +++ b/skein/benches/skein512.rs @@ -1,7 +1,7 @@ #![feature(test)] extern crate test; -use digest::{bench_update, generic_array::typenum::U64}; +use digest::{array::typenum::U64, bench_update}; use skein::Skein512; use test::Bencher; diff --git a/skein/src/lib.rs b/skein/src/lib.rs index 6f6bcf76e..57a489034 100644 --- a/skein/src/lib.rs +++ b/skein/src/lib.rs @@ -46,13 +46,13 @@ pub use digest::{self, consts, Digest}; use core::{fmt, marker::PhantomData}; use digest::{ + array::{typenum::Unsigned, Array, ArraySize}, block_buffer::Lazy, consts::{U128, U32, U64}, core_api::{ AlgorithmName, Block, BlockSizeUser, Buffer, BufferKindUser, CoreWrapper, FixedOutputCore, OutputSizeUser, Reset, UpdateCore, }, - generic_array::{typenum::Unsigned, ArrayLength, GenericArray}, HashMarker, Output, }; use threefish::{Threefish1024, Threefish256, Threefish512}; @@ -76,13 +76,13 @@ macro_rules! define_hasher { #[doc = $alg_name] #[doc = " core hasher state"] #[derive(Clone)] - pub struct $name + 'static> { + pub struct $name { t: [u64; 2], x: [u64; <$state_bytes>::USIZE / 8], _pd: PhantomData, } - impl + 'static> $name { + impl $name { fn blank_state(t1: u64, x: [u64; <$state_bytes>::USIZE / 8]) -> Self { Self { t: [0, t1], @@ -91,11 +91,7 @@ macro_rules! define_hasher { } } - fn process_block( - &mut self, - block: &GenericArray, - byte_count_add: usize, - ) { + fn process_block(&mut self, block: &Array, byte_count_add: usize) { const STATE_WORDS: usize = <$state_bytes>::USIZE / 8; self.t[0] += byte_count_add as u64; @@ -116,21 +112,21 @@ macro_rules! define_hasher { } } - impl HashMarker for $name where N: ArrayLength + 'static {} + impl HashMarker for $name where N: ArraySize + 'static {} - impl + 'static> BlockSizeUser for $name { + impl BlockSizeUser for $name { type BlockSize = $state_bytes; } - impl + 'static> BufferKindUser for $name { + impl BufferKindUser for $name { type BufferKind = Lazy; } - impl + 'static> OutputSizeUser for $name { + impl OutputSizeUser for $name { type OutputSize = N; } - impl + 'static> UpdateCore for $name { + impl UpdateCore for $name { #[inline] fn update_blocks(&mut self, blocks: &[Block]) { for block in blocks { @@ -139,17 +135,17 @@ macro_rules! define_hasher { } } - impl + 'static> FixedOutputCore for $name { + impl FixedOutputCore for $name { #[inline] fn finalize_fixed_core(&mut self, buffer: &mut Buffer, out: &mut Output) { self.t[1] |= T1_FLAG_FINAL; let pos = buffer.get_pos(); let final_block = buffer.pad_with_zeros(); - self.process_block(final_block, pos); + self.process_block(&final_block, pos); // run Threefish in "counter mode" to generate output let flag = T1_FLAG_FIRST | T1_BLK_TYPE_OUT | T1_FLAG_FINAL; - let mut block = GenericArray::::default(); + let mut block = Array::::default(); for (i, chunk) in out.chunks_mut(<$state_bytes>::USIZE).enumerate() { let mut ctr = Self::blank_state(flag, self.x); @@ -163,7 +159,7 @@ macro_rules! define_hasher { } } - impl + 'static> Default for $name { + impl Default for $name { fn default() -> Self { // build and process config block let mut state = Self::blank_state( @@ -171,7 +167,7 @@ macro_rules! define_hasher { Default::default(), ); - let mut cfg = GenericArray::::default(); + let mut cfg = Array::::default(); cfg[..8].copy_from_slice(&SCHEMA_VER.to_le_bytes()); cfg[8..16].copy_from_slice(&(N::to_u64() * 8).to_le_bytes()); cfg[16..24].copy_from_slice(&CFG_TREE_INFO_SEQUENTIAL.to_le_bytes()); @@ -185,20 +181,20 @@ macro_rules! define_hasher { } } - impl + 'static> Reset for $name { + impl Reset for $name { #[inline] fn reset(&mut self) { *self = Default::default(); } } - impl + 'static> AlgorithmName for $name { + impl AlgorithmName for $name { fn write_alg_name(f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(stringify!($full_name)) } } - impl + 'static> fmt::Debug for $name { + impl fmt::Debug for $name { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { write!(f, "{}<{}> {{ .. }}", stringify!($name), N::USIZE) } diff --git a/sm3/Cargo.toml b/sm3/Cargo.toml index c1d46567b..9d5dc3ca8 100644 --- a/sm3/Cargo.toml +++ b/sm3/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "sm3" -version = "0.4.2" +version = "0.5.0-pre" 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" documentation = "https://docs.rs/sm3" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "sm3", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/streebog/Cargo.toml b/streebog/Cargo.toml index bc5bddc54..2099a90f9 100644 --- a/streebog/Cargo.toml +++ b/streebog/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "streebog" -version = "0.10.2" +version = "0.11.0-pre" 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" documentation = "https://docs.rs/streebog" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "streebog", "gost", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] 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/tiger/Cargo.toml b/tiger/Cargo.toml index a8f59a4c7..e569938c2 100644 --- a/tiger/Cargo.toml +++ b/tiger/Cargo.toml @@ -1,22 +1,23 @@ [package] name = "tiger" -version = "0.2.1" +version = "0.3.0-pre" description = "Tiger hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/tiger" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "hash", "tiger", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/tiger/src/lib.rs b/tiger/src/lib.rs index ed2830a7d..e288b252e 100644 --- a/tiger/src/lib.rs +++ b/tiger/src/lib.rs @@ -14,7 +14,7 @@ //! // process input message //! hasher.update(b"hello world"); //! -//! // acquire hash digest in the form of GenericArray, +//! // acquire hash digest in the form of Array, //! // which in this case is equivalent to [u8; 24] //! let result = hasher.finalize(); //! assert_eq!(result[..], hex!("4c8fbddae0b6f25832af45e7c62811bb64ec3e43691e9cc3")); diff --git a/whirlpool/Cargo.toml b/whirlpool/Cargo.toml index ee3e53bfd..81d4d36e2 100644 --- a/whirlpool/Cargo.toml +++ b/whirlpool/Cargo.toml @@ -1,25 +1,26 @@ [package] name = "whirlpool" -version = "0.10.4" +version = "0.11.0-pre" description = "Whirlpool hash function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2018" +edition = "2021" documentation = "https://docs.rs/whirlpool" repository = "https://github.com/RustCrypto/hashes" keywords = ["crypto", "whirlpool", "hash", "digest"] categories = ["cryptography", "no-std"] +rust-version = "1.71" [dependencies] -digest = "0.10.7" +digest = "=0.11.0-pre.3" [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] whirlpool-asm = { version = "0.6", optional = true} [dev-dependencies] -digest = { version = "0.10.7", features = ["dev"] } -hex-literal = "0.2.2" +digest = { version = "=0.11.0-pre.3", features = ["dev"] } +hex-literal = "0.4" [features] default = ["std"] diff --git a/whirlpool/src/lib.rs b/whirlpool/src/lib.rs index b5f0ff32f..6e1293cd2 100644 --- a/whirlpool/src/lib.rs +++ b/whirlpool/src/lib.rs @@ -170,7 +170,7 @@ const BLOCK_SIZE: usize = ::BlockSize::USIZE; #[inline(always)] fn convert(blocks: &[Block]) -> &[[u8; BLOCK_SIZE]] { - // SAFETY: GenericArray and [u8; 64] have + // SAFETY: Array and [u8; 64] have // exactly the same memory layout let p = blocks.as_ptr() as *const [u8; BLOCK_SIZE]; unsafe { core::slice::from_raw_parts(p, blocks.len()) }