diff --git a/.github/workflows/aes.yml b/.github/workflows/aes.yml index 8b964f06..3dcace83 100644 --- a/.github/workflows/aes.yml +++ b/.github/workflows/aes.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -74,7 +74,7 @@ jobs: include: # 32-bit Linux - target: i686-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV deps: sudo apt update && sudo apt install gcc-multilib - target: i686-unknown-linux-gnu rust: stable @@ -82,7 +82,7 @@ jobs: # 64-bit Linux - target: x86_64-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV - target: x86_64-unknown-linux-gnu rust: stable steps: @@ -105,7 +105,7 @@ jobs: include: # 32-bit Linux - target: i686-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV deps: sudo apt update && sudo apt install gcc-multilib - target: i686-unknown-linux-gnu rust: stable @@ -113,7 +113,7 @@ jobs: # 64-bit Linux - target: x86_64-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV - target: x86_64-unknown-linux-gnu rust: stable steps: @@ -138,7 +138,7 @@ jobs: include: # 32-bit Linux - target: i686-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV deps: sudo apt update && sudo apt install gcc-multilib - target: i686-unknown-linux-gnu rust: stable @@ -146,7 +146,7 @@ jobs: # 64-bit Linux - target: x86_64-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV - target: x86_64-unknown-linux-gnu rust: stable steps: @@ -168,13 +168,13 @@ jobs: include: # ARM64 - target: aarch64-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV - target: aarch64-unknown-linux-gnu rust: stable # PPC32 - target: powerpc-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV - target: powerpc-unknown-linux-gnu rust: stable runs-on: ubuntu-latest @@ -216,7 +216,7 @@ jobs: matrix: include: - target: aarch64-unknown-linux-gnu - rust: 1.84.0 # MSRV + rust: 1.85.0 # MSRV runs-on: ubuntu-latest # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml defaults: @@ -244,6 +244,6 @@ jobs: - uses: RustCrypto/actions/cargo-cache@master - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.84.0 # MSRV + toolchain: 1.85.0 # MSRV components: clippy - run: cargo clippy --features hazmat -- -D warnings diff --git a/.github/workflows/aria.yml b/.github/workflows/aria.yml index 7cbe25c6..70c50d2f 100644 --- a/.github/workflows/aria.yml +++ b/.github/workflows/aria.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/belt-block.yml b/.github/workflows/belt-block.yml index f49aadbd..1c387538 100644 --- a/.github/workflows/belt-block.yml +++ b/.github/workflows/belt-block.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.83.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/blowfish.yml b/.github/workflows/blowfish.yml index 6fdc9041..8163cd1c 100644 --- a/.github/workflows/blowfish.yml +++ b/.github/workflows/blowfish.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/camellia.yml b/.github/workflows/camellia.yml index 5940b8a6..f11920a2 100644 --- a/.github/workflows/camellia.yml +++ b/.github/workflows/camellia.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/cast5.yml b/.github/workflows/cast5.yml index 1bbaa6b7..7e576fc3 100644 --- a/.github/workflows/cast5.yml +++ b/.github/workflows/cast5.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/cast6.yml b/.github/workflows/cast6.yml index e0b1c072..95985d8d 100644 --- a/.github/workflows/cast6.yml +++ b/.github/workflows/cast6.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/des.yml b/.github/workflows/des.yml index a241fe05..65f8bf58 100644 --- a/.github/workflows/des.yml +++ b/.github/workflows/des.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/gift.yml b/.github/workflows/gift.yml index 8c35c520..416b91a6 100644 --- a/.github/workflows/gift.yml +++ b/.github/workflows/gift.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/idea.yml b/.github/workflows/idea.yml index 08751355..9c4c5db9 100644 --- a/.github/workflows/idea.yml +++ b/.github/workflows/idea.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/kuznyechik.yml b/.github/workflows/kuznyechik.yml index e9a9b0c3..4d4c24ab 100644 --- a/.github/workflows/kuznyechik.yml +++ b/.github/workflows/kuznyechik.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -55,7 +55,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 @@ -82,7 +82,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 + - 1.85.0 - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/magma.yml b/.github/workflows/magma.yml index 257d686f..dfc560bb 100644 --- a/.github/workflows/magma.yml +++ b/.github/workflows/magma.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/rc2.yml b/.github/workflows/rc2.yml index c9aa06da..c6e596bc 100644 --- a/.github/workflows/rc2.yml +++ b/.github/workflows/rc2.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/rc5.yml b/.github/workflows/rc5.yml index f1f1388f..a6e010f8 100644 --- a/.github/workflows/rc5.yml +++ b/.github/workflows/rc5.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/serpent.yml b/.github/workflows/serpent.yml index 0ef53224..e6d83c6f 100644 --- a/.github/workflows/serpent.yml +++ b/.github/workflows/serpent.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/sm4.yml b/.github/workflows/sm4.yml index f9c77180..b37c858c 100644 --- a/.github/workflows/sm4.yml +++ b/.github/workflows/sm4.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -47,7 +47,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/speck.yml b/.github/workflows/speck.yml index 84267e9f..1765c489 100644 --- a/.github/workflows/speck.yml +++ b/.github/workflows/speck.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -54,7 +54,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/threefish.yml b/.github/workflows/threefish.yml index 7f7a3d58..3a6287ed 100644 --- a/.github/workflows/threefish.yml +++ b/.github/workflows/threefish.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/twofish.yml b/.github/workflows/twofish.yml index b188c54d..b7dbe188 100644 --- a/.github/workflows/twofish.yml +++ b/.github/workflows/twofish.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 766e89c3..5bd73d91 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -17,7 +17,7 @@ jobs: - uses: RustCrypto/actions/cargo-cache@master - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.84.0 + toolchain: 1.85.0 components: clippy - run: cargo clippy --all --exclude aes --all-features -- -D warnings diff --git a/.github/workflows/xtea.yml b/.github/workflows/xtea.yml index 1c56f397..ac9937c8 100644 --- a/.github/workflows/xtea.yml +++ b/.github/workflows/xtea.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.84.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index c3a6d887..bd6ac51d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aes" @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "blobby" -version = "0.3.1" +version = "0.4.0-pre.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847495c209977a90e8aad588b959d0ca9f5dc228096d29a6bd3defd53f35eaec" +checksum = "4a859067dcb257cb2ae028cb821399b55140b76fb8b2a360e052fe109019db43" [[package]] name = "blowfish" @@ -81,8 +81,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cipher" -version = "0.5.0-pre.7" -source = "git+https://github.com/RustCrypto/traits.git#efe27ed0cca4ac6bc1ce993c8e49b156cd74f9d8" +version = "0.5.0-pre.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276974d2acb7cf592603150941fc1ff6442acdeb1dc653ac2825928f4703c131" dependencies = [ "blobby", "crypto-common", @@ -101,8 +102,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.0-rc.1" -source = "git+https://github.com/RustCrypto/traits.git#efe27ed0cca4ac6bc1ce993c8e49b156cd74f9d8" +version = "0.2.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170d71b5b14dec99db7739f6fc7d6ec2db80b78c3acb77db48392ccc3d8a9ea0" dependencies = [ "hybrid-array", ] @@ -125,15 +127,15 @@ dependencies = [ [[package]] name = "hex-literal" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" [[package]] name = "hybrid-array" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +checksum = "4dab50e193aebe510fe0e40230145820e02f48dae0cf339ea4204e6e708ff7bd" dependencies = [ "typenum", "zeroize", @@ -148,9 +150,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.0-rc.3" +version = "0.2.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de49db00f5add6dad75a57946b75de0f26287a6fc95f4f277d48419200422beb" +checksum = "ac5e145e8ade9f74c0a5efc60ccb4e714b0144f7e2220b7ca64254feee71c57f" dependencies = [ "hybrid-array", ] diff --git a/Cargo.toml b/Cargo.toml index 5d2dfce2..bb72fd38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -resolver = "2" +resolver = "3" members = [ "aes", "aria", @@ -25,9 +25,3 @@ members = [ [profile.dev] opt-level = 2 - -[patch.crates-io] -# https://github.com/RustCrypto/traits/pull/1742 -# https://github.com/RustCrypto/traits/pull/1747 -cipher = { git = "https://github.com/RustCrypto/traits.git" } -crypto-common = { git = "https://github.com/RustCrypto/traits.git" } diff --git a/README.md b/README.md index 27980166..a5c2e60d 100644 --- a/README.md +++ b/README.md @@ -36,29 +36,25 @@ It's generally recommended not to use other cipher implementations in this repos | Name | Crate name | crates.io | Docs | MSRV | |------|------------|-----------|------|------| -| [AES] (Rijndael) | [`aes`] | [![crates.io](https://img.shields.io/crates/v/aes.svg)](https://crates.io/crates/aes) | [![Documentation](https://docs.rs/aes/badge.svg)](https://docs.rs/aes) | ![MSRV 1.65][msrv-1.65] | -| [ARIA] | [`aria`] | [![crates.io](https://img.shields.io/crates/v/aria.svg)](https://crates.io/crates/aria) | [![Documentation](https://docs.rs/aria/badge.svg)](https://docs.rs/aria) | ![MSRV 1.65][msrv-1.65] | -| [BelT] block cipher | [`belt-block`] | [![crates.io](https://img.shields.io/crates/v/belt-block.svg)](https://crates.io/crates/belt-block) | [![Documentation](https://docs.rs/belt-block/badge.svg)](https://docs.rs/belt-block) | ![MSRV 1.65][msrv-1.65] | -| [Blowfish] | [`blowfish`] | [![crates.io](https://img.shields.io/crates/v/blowfish.svg)](https://crates.io/crates/blowfish) | [![Documentation](https://docs.rs/blowfish/badge.svg)](https://docs.rs/blowfish) | ![MSRV 1.65][msrv-1.65] | -| [Camellia] | [`camellia`] | [![crates.io](https://img.shields.io/crates/v/camellia.svg)](https://crates.io/crates/camellia) | [![Documentation](https://docs.rs/camellia/badge.svg)](https://docs.rs/camellia) | ![MSRV 1.65][msrv-1.65] | -| [CAST5] (CAST-128) | [`cast5`] | [![crates.io](https://img.shields.io/crates/v/cast5.svg)](https://crates.io/crates/cast5) | [![Documentation](https://docs.rs/cast5/badge.svg)](https://docs.rs/cast5) | ![MSRV 1.65][msrv-1.65] | -| [CAST6] (CAST-256) | [`cast6`] | [![crates.io](https://img.shields.io/crates/v/cast6.svg)](https://crates.io/crates/cast6) | [![Documentation](https://docs.rs/cast6/badge.svg)](https://docs.rs/cast6) | ![MSRV 1.65][msrv-1.65] | -| [DES] + [3DES] (DEA, 3DEA) | [`des`] | [![crates.io](https://img.shields.io/crates/v/des.svg)](https://crates.io/crates/des) | [![Documentation](https://docs.rs/des/badge.svg)](https://docs.rs/des) | ![MSRV 1.65][msrv-1.65] | -| [IDEA] | [`idea`] | [![crates.io](https://img.shields.io/crates/v/idea.svg)](https://crates.io/crates/idea) | [![Documentation](https://docs.rs/idea/badge.svg)](https://docs.rs/idea) | ![MSRV 1.65][msrv-1.65] | -| [Kuznyechik] (GOST R 34.12-2015) | [`kuznyechik`] | [![crates.io](https://img.shields.io/crates/v/kuznyechik.svg)](https://crates.io/crates/kuznyechik) | [![Documentation](https://docs.rs/kuznyechik/badge.svg)](https://docs.rs/kuznyechik) | ![MSRV 1.65][msrv-1.65] | -| [Magma] (GOST R 34.12-2015) | [`magma`] | [![crates.io](https://img.shields.io/crates/v/magma.svg)](https://crates.io/crates/magma) | [![Documentation](https://docs.rs/magma/badge.svg)](https://docs.rs/magma) | ![MSRV 1.65][msrv-1.65] | -| [RC2] (ARC2) | [`rc2`] | [![crates.io](https://img.shields.io/crates/v/rc2.svg)](https://crates.io/crates/rc2) | [![Documentation](https://docs.rs/rc2/badge.svg)](https://docs.rs/rc2) | ![MSRV 1.65][msrv-1.65] | -| [RC5] | [`rc5`] | [![crates.io](https://img.shields.io/crates/v/rc5.svg)](https://crates.io/crates/rc5) | [![Documentation](https://docs.rs/rc5/badge.svg)](https://docs.rs/rc5) | ![MSRV 1.65][msrv-1.65] | -| [Serpent] | [`serpent`] | [![crates.io](https://img.shields.io/crates/v/serpent.svg)](https://crates.io/crates/serpent) | [![Documentation](https://docs.rs/serpent/badge.svg)](https://docs.rs/serpent) | ![MSRV 1.65][msrv-1.65] | -| [SM4] | [`sm4`] | [![crates.io](https://img.shields.io/crates/v/sm4.svg)](https://crates.io/crates/sm4) | [![Documentation](https://docs.rs/sm4/badge.svg)](https://docs.rs/sm4) | ![MSRV 1.65][msrv-1.65] | -| [Speck] | [`speck-cipher`] | [![crates.io](https://img.shields.io/crates/v/speck-cipher.svg)](https://crates.io/crates/speck-cipher) | [![Documentation](https://docs.rs/speck-cipher/badge.svg)](https://docs.rs/speck-cipher) | ![MSRV 1.65][msrv-1.65] | -| [Threefish] | [`threefish`] | [![crates.io](https://img.shields.io/crates/v/threefish.svg)](https://crates.io/crates/threefish) | [![Documentation](https://docs.rs/threefish/badge.svg)](https://docs.rs/threefish) | ![MSRV 1.65][msrv-1.65] | -| [Twofish] | [`twofish`] | [![crates.io](https://img.shields.io/crates/v/twofish.svg)](https://crates.io/crates/twofish) | [![Documentation](https://docs.rs/twofish/badge.svg)](https://docs.rs/twofish) | ![MSRV 1.65][msrv-1.65] | -| [XTEA] | [`xtea`] | [![crates.io](https://img.shields.io/crates/v/xtea.svg)](https://crates.io/crates/xtea) | [![Documentation](https://docs.rs/xtea/badge.svg)](https://docs.rs/xtea) | ![MSRV 1.65][msrv-1.65] | - -### Minimum Supported Rust Version (MSRV) Policy - -MSRV bump is considered a breaking change and will be performed only with a minor version bump. +| [AES] (Rijndael) | [`aes`] | [![crates.io](https://img.shields.io/crates/v/aes.svg)](https://crates.io/crates/aes) | [![Documentation](https://docs.rs/aes/badge.svg)](https://docs.rs/aes) | ![MSRV 1.85][msrv-1.85] | +| [ARIA] | [`aria`] | [![crates.io](https://img.shields.io/crates/v/aria.svg)](https://crates.io/crates/aria) | [![Documentation](https://docs.rs/aria/badge.svg)](https://docs.rs/aria) | ![MSRV 1.85][msrv-1.85] | +| [BelT] block cipher | [`belt-block`] | [![crates.io](https://img.shields.io/crates/v/belt-block.svg)](https://crates.io/crates/belt-block) | [![Documentation](https://docs.rs/belt-block/badge.svg)](https://docs.rs/belt-block) | ![MSRV 1.85][msrv-1.85] | +| [Blowfish] | [`blowfish`] | [![crates.io](https://img.shields.io/crates/v/blowfish.svg)](https://crates.io/crates/blowfish) | [![Documentation](https://docs.rs/blowfish/badge.svg)](https://docs.rs/blowfish) | ![MSRV 1.85][msrv-1.85] | +| [Camellia] | [`camellia`] | [![crates.io](https://img.shields.io/crates/v/camellia.svg)](https://crates.io/crates/camellia) | [![Documentation](https://docs.rs/camellia/badge.svg)](https://docs.rs/camellia) | ![MSRV 1.85][msrv-1.85] | +| [CAST5] (CAST-128) | [`cast5`] | [![crates.io](https://img.shields.io/crates/v/cast5.svg)](https://crates.io/crates/cast5) | [![Documentation](https://docs.rs/cast5/badge.svg)](https://docs.rs/cast5) | ![MSRV 1.85][msrv-1.85] | +| [CAST6] (CAST-256) | [`cast6`] | [![crates.io](https://img.shields.io/crates/v/cast6.svg)](https://crates.io/crates/cast6) | [![Documentation](https://docs.rs/cast6/badge.svg)](https://docs.rs/cast6) | ![MSRV 1.85][msrv-1.85] | +| [DES] + [3DES] (DEA, 3DEA) | [`des`] | [![crates.io](https://img.shields.io/crates/v/des.svg)](https://crates.io/crates/des) | [![Documentation](https://docs.rs/des/badge.svg)](https://docs.rs/des) | ![MSRV 1.85][msrv-1.85] | +| [IDEA] | [`idea`] | [![crates.io](https://img.shields.io/crates/v/idea.svg)](https://crates.io/crates/idea) | [![Documentation](https://docs.rs/idea/badge.svg)](https://docs.rs/idea) | ![MSRV 1.85][msrv-1.85] | +| [Kuznyechik] (GOST R 34.12-2015) | [`kuznyechik`] | [![crates.io](https://img.shields.io/crates/v/kuznyechik.svg)](https://crates.io/crates/kuznyechik) | [![Documentation](https://docs.rs/kuznyechik/badge.svg)](https://docs.rs/kuznyechik) | ![MSRV 1.85][msrv-1.85] | +| [Magma] (GOST R 34.12-2015) | [`magma`] | [![crates.io](https://img.shields.io/crates/v/magma.svg)](https://crates.io/crates/magma) | [![Documentation](https://docs.rs/magma/badge.svg)](https://docs.rs/magma) | ![MSRV 1.85][msrv-1.85] | +| [RC2] (ARC2) | [`rc2`] | [![crates.io](https://img.shields.io/crates/v/rc2.svg)](https://crates.io/crates/rc2) | [![Documentation](https://docs.rs/rc2/badge.svg)](https://docs.rs/rc2) | ![MSRV 1.85][msrv-1.85] | +| [RC5] | [`rc5`] | [![crates.io](https://img.shields.io/crates/v/rc5.svg)](https://crates.io/crates/rc5) | [![Documentation](https://docs.rs/rc5/badge.svg)](https://docs.rs/rc5) | ![MSRV 1.85][msrv-1.85] | +| [Serpent] | [`serpent`] | [![crates.io](https://img.shields.io/crates/v/serpent.svg)](https://crates.io/crates/serpent) | [![Documentation](https://docs.rs/serpent/badge.svg)](https://docs.rs/serpent) | ![MSRV 1.85][msrv-1.85] | +| [SM4] | [`sm4`] | [![crates.io](https://img.shields.io/crates/v/sm4.svg)](https://crates.io/crates/sm4) | [![Documentation](https://docs.rs/sm4/badge.svg)](https://docs.rs/sm4) | ![MSRV 1.85][msrv-1.85] | +| [Speck] | [`speck-cipher`] | [![crates.io](https://img.shields.io/crates/v/speck-cipher.svg)](https://crates.io/crates/speck-cipher) | [![Documentation](https://docs.rs/speck-cipher/badge.svg)](https://docs.rs/speck-cipher) | ![MSRV 1.85][msrv-1.85] | +| [Threefish] | [`threefish`] | [![crates.io](https://img.shields.io/crates/v/threefish.svg)](https://crates.io/crates/threefish) | [![Documentation](https://docs.rs/threefish/badge.svg)](https://docs.rs/threefish) | ![MSRV 1.85][msrv-1.85] | +| [Twofish] | [`twofish`] | [![crates.io](https://img.shields.io/crates/v/twofish.svg)](https://crates.io/crates/twofish) | [![Documentation](https://docs.rs/twofish/badge.svg)](https://docs.rs/twofish) | ![MSRV 1.85][msrv-1.85] | +| [XTEA] | [`xtea`] | [![crates.io](https://img.shields.io/crates/v/xtea.svg)](https://crates.io/crates/xtea) | [![Documentation](https://docs.rs/xtea/badge.svg)](https://docs.rs/xtea) | ![MSRV 1.85][msrv-1.85] | ## License @@ -84,7 +80,7 @@ dual licensed as above, without any additional terms or conditions. [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg [hazmat-image]: https://img.shields.io/badge/crypto-hazmat%E2%9A%A0-red.svg [hazmat-link]: https://github.com/RustCrypto/meta/blob/master/HAZMAT.md -[msrv-1.65]: https://img.shields.io/badge/rustc-1.65.0+-blue.svg +[msrv-1.85]: https://img.shields.io/badge/rustc-1.85.0+-blue.svg [//]: # (crates) diff --git a/aes/Cargo.toml b/aes/Cargo.toml index cbe2c1ce..0fb252d3 100644 --- a/aes/Cargo.toml +++ b/aes/Cargo.toml @@ -4,8 +4,8 @@ version = "0.9.0-pre.2" description = "Pure Rust implementation of the Advanced Encryption Standard (a.k.a. Rijndael)" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.72" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/aes" repository = "https://github.com/RustCrypto/block-ciphers" @@ -14,7 +14,7 @@ categories = ["cryptography", "no-std"] [dependencies] cfg-if = "1" -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" zeroize = { version = "1.5.6", optional = true, default-features = false, features = [ "aarch64", ] } @@ -23,8 +23,8 @@ zeroize = { version = "1.5.6", optional = true, default-features = false, featur cpufeatures = "0.2" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] hazmat = [] # Expose cryptographically hazardous APIs diff --git a/aes/benches/mod.rs b/aes/benches/mod.rs index 579b0731..8dd47a21 100644 --- a/aes/benches/mod.rs +++ b/aes/benches/mod.rs @@ -1,7 +1,7 @@ #![feature(test)] extern crate test; -use cipher::{block_decryptor_bench, block_encryptor_bench, KeyInit}; +use cipher::{KeyInit, block_decryptor_bench, block_encryptor_bench}; block_encryptor_bench!( Key: aes::Aes128, diff --git a/aes/src/armv8.rs b/aes/src/armv8.rs index ab684c5a..1a79fa25 100644 --- a/aes/src/armv8.rs +++ b/aes/src/armv8.rs @@ -18,10 +18,10 @@ mod expand; mod test_expand; use cipher::{ - consts::{self, U16, U24, U32}, - crypto_common::WeakKeyError, AlgorithmName, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, Key, KeyInit, KeySizeUser, + consts::{self, U16, U24, U32}, + crypto_common::WeakKeyError, }; use core::fmt; diff --git a/aes/src/armv8/encdec.rs b/aes/src/armv8/encdec.rs index c3559b54..7b990b07 100644 --- a/aes/src/armv8/encdec.rs +++ b/aes/src/armv8/encdec.rs @@ -2,6 +2,7 @@ //! //! Note that `aes` target feature implicitly enables `neon`, see: //! https://doc.rust-lang.org/reference/attributes/codegen.html#aarch64 +#![allow(unsafe_op_in_unsafe_fn)] use crate::Block; use cipher::{ diff --git a/aes/src/armv8/expand.rs b/aes/src/armv8/expand.rs index f6c2fa7b..1136b2a9 100644 --- a/aes/src/armv8/expand.rs +++ b/aes/src/armv8/expand.rs @@ -1,4 +1,5 @@ //! AES key expansion support. +#![allow(unsafe_op_in_unsafe_fn)] use core::{arch::aarch64::*, mem, slice}; diff --git a/aes/src/armv8/hazmat.rs b/aes/src/armv8/hazmat.rs index 1820679a..053704c1 100644 --- a/aes/src/armv8/hazmat.rs +++ b/aes/src/armv8/hazmat.rs @@ -3,6 +3,7 @@ //! Note: this isn't actually used in the `Aes128`/`Aes192`/`Aes256` //! implementations in this crate, but instead provides raw AES-NI accelerated //! access to the AES round function gated under the `hazmat` crate feature. +#![allow(unsafe_op_in_unsafe_fn)] use crate::hazmat::{Block, Block8}; use core::arch::aarch64::*; diff --git a/aes/src/autodetect.rs b/aes/src/autodetect.rs index b1510679..802680ab 100644 --- a/aes/src/autodetect.rs +++ b/aes/src/autodetect.rs @@ -3,10 +3,10 @@ use crate::soft; use cipher::{ - consts::{U16, U24, U32}, - crypto_common::WeakKeyError, AlgorithmName, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, Key, KeyInit, KeySizeUser, + consts::{U16, U24, U32}, + crypto_common::WeakKeyError, }; use core::fmt; use core::mem::ManuallyDrop; diff --git a/aes/src/lib.rs b/aes/src/lib.rs index f4c23b88..6b27ee39 100644 --- a/aes/src/lib.rs +++ b/aes/src/lib.rs @@ -186,7 +186,7 @@ mod tests { use super::soft; fn test_for(val: T) { - use core::mem::{size_of, ManuallyDrop}; + use core::mem::{ManuallyDrop, size_of}; let mut val = ManuallyDrop::new(val); let ptr = &val as *const _ as *const u8; diff --git a/aes/src/ni.rs b/aes/src/ni.rs index 14068397..9a798102 100644 --- a/aes/src/ni.rs +++ b/aes/src/ni.rs @@ -29,10 +29,10 @@ use core::arch::x86 as arch; use core::arch::x86_64 as arch; use cipher::{ - consts::{self, U16, U24, U32}, - crypto_common::WeakKeyError, AlgorithmName, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, Key, KeyInit, KeySizeUser, + consts::{self, U16, U24, U32}, + crypto_common::WeakKeyError, }; use core::fmt; diff --git a/aes/src/ni/encdec.rs b/aes/src/ni/encdec.rs index 2f763ee4..12db0da2 100644 --- a/aes/src/ni/encdec.rs +++ b/aes/src/ni/encdec.rs @@ -1,3 +1,5 @@ +#![allow(unsafe_op_in_unsafe_fn)] + use super::arch::*; use crate::Block; use cipher::{ diff --git a/aes/src/ni/expand.rs b/aes/src/ni/expand.rs index afbc6587..325c4c34 100644 --- a/aes/src/ni/expand.rs +++ b/aes/src/ni/expand.rs @@ -1,3 +1,5 @@ +#![allow(unsafe_op_in_unsafe_fn)] + use super::arch::*; use core::mem::{transmute, zeroed}; diff --git a/aes/src/ni/hazmat.rs b/aes/src/ni/hazmat.rs index 610833f2..0e9a9cd2 100644 --- a/aes/src/ni/hazmat.rs +++ b/aes/src/ni/hazmat.rs @@ -3,6 +3,7 @@ //! Note: this isn't actually used in the `Aes128`/`Aes192`/`Aes256` //! implementations in this crate, but instead provides raw AES-NI accelerated //! access to the AES round function gated under the `hazmat` crate feature. +#![allow(unsafe_op_in_unsafe_fn)] use super::arch::*; use crate::hazmat::{Block, Block8}; diff --git a/aes/src/ni/test_expand.rs b/aes/src/ni/test_expand.rs index d6e71b7b..973f827d 100644 --- a/aes/src/ni/test_expand.rs +++ b/aes/src/ni/test_expand.rs @@ -18,7 +18,7 @@ pub(crate) fn check(a: &[__m128i], b: &[[u64; 2]]) { fn aes128_expand_key_test() { let keys = [0x00; 16]; check( - unsafe { &aes128_expand_key(&keys) }, + &unsafe { aes128_expand_key(&keys) }, &[ [0x0000000000000000, 0x0000000000000000], [0x6263636362636363, 0x6263636362636363], @@ -36,7 +36,7 @@ fn aes128_expand_key_test() { let keys = [0xff; 16]; check( - unsafe { &aes128_expand_key(&keys) }, + &unsafe { aes128_expand_key(&keys) }, &[ [0xffffffffffffffff, 0xffffffffffffffff], [0xe8e9e9e917161616, 0xe8e9e9e917161616], @@ -54,7 +54,7 @@ fn aes128_expand_key_test() { let keys = hex!("000102030405060708090a0b0c0d0e0f"); check( - unsafe { &aes128_expand_key(&keys) }, + &unsafe { aes128_expand_key(&keys) }, &[ [0x0001020304050607, 0x08090a0b0c0d0e0f], [0xd6aa74fdd2af72fa, 0xdaa678f1d6ab76fe], @@ -72,7 +72,7 @@ fn aes128_expand_key_test() { let keys = hex!("6920e299a5202a6d656e636869746f2a"); check( - unsafe { &aes128_expand_key(&keys) }, + &unsafe { aes128_expand_key(&keys) }, &[ [0x6920e299a5202a6d, 0x656e636869746f2a], [0xfa8807605fa82d0d, 0x3ac64e6553b2214f], @@ -90,7 +90,7 @@ fn aes128_expand_key_test() { let keys = hex!("2b7e151628aed2a6abf7158809cf4f3c"); check( - unsafe { &aes128_expand_key(&keys) }, + &unsafe { aes128_expand_key(&keys) }, &[ [0x2b7e151628aed2a6, 0xabf7158809cf4f3c], [0xa0fafe1788542cb1, 0x23a339392a6c7605], @@ -115,7 +115,7 @@ fn aes128_expand_key_test() { fn aes192_expand_key_test() { let keys = [0x00; 24]; check( - unsafe { &aes192_expand_key(&keys) }, + &unsafe { aes192_expand_key(&keys) }, &[ [0x0000000000000000, 0x0000000000000000], [0x0000000000000000, 0x6263636362636363], @@ -135,7 +135,7 @@ fn aes192_expand_key_test() { let keys = [0xff; 24]; check( - unsafe { &aes192_expand_key(&keys) }, + &unsafe { aes192_expand_key(&keys) }, &[ [0xffffffffffffffff, 0xffffffffffffffff], [0xffffffffffffffff, 0xe8e9e9e917161616], @@ -155,7 +155,7 @@ fn aes192_expand_key_test() { let keys = hex!("000102030405060708090a0b0c0d0e0f1011121314151617"); check( - unsafe { &aes192_expand_key(&keys) }, + &unsafe { aes192_expand_key(&keys) }, &[ [0x0001020304050607, 0x08090a0b0c0d0e0f], [0x1011121314151617, 0x5846f2f95c43f4fe], @@ -175,7 +175,7 @@ fn aes192_expand_key_test() { let keys = hex!("8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"); check( - unsafe { &aes192_expand_key(&keys) }, + &unsafe { aes192_expand_key(&keys) }, &[ [0x8e73b0f7da0e6452, 0xc810f32b809079e5], [0x62f8ead2522c6b7b, 0xfe0c91f72402f5a5], @@ -202,7 +202,7 @@ fn aes192_expand_key_test() { fn aes256_expand_key_test() { let keys = [0x00; 32]; check( - unsafe { &aes256_expand_key(&keys) }, + &unsafe { aes256_expand_key(&keys) }, &[ [0x0000000000000000, 0x0000000000000000], [0x0000000000000000, 0x0000000000000000], @@ -224,7 +224,7 @@ fn aes256_expand_key_test() { let keys = [0xff; 32]; check( - unsafe { &aes256_expand_key(&keys) }, + &unsafe { aes256_expand_key(&keys) }, &[ [0xffffffffffffffff, 0xffffffffffffffff], [0xffffffffffffffff, 0xffffffffffffffff], @@ -246,7 +246,7 @@ fn aes256_expand_key_test() { let keys = hex!("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"); check( - unsafe { &aes256_expand_key(&keys) }, + &unsafe { aes256_expand_key(&keys) }, &[ [0x0001020304050607, 0x08090a0b0c0d0e0f], [0x1011121314151617, 0x18191a1b1c1d1e1f], @@ -268,7 +268,7 @@ fn aes256_expand_key_test() { let keys = hex!("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"); check( - unsafe { &aes256_expand_key(&keys) }, + &unsafe { aes256_expand_key(&keys) }, &[ [0x603deb1015ca71be, 0x2b73aef0857d7781], [0x1f352c073b6108d7, 0x2d9810a30914dff4], diff --git a/aes/src/soft.rs b/aes/src/soft.rs index 762618cb..f8d60617 100644 --- a/aes/src/soft.rs +++ b/aes/src/soft.rs @@ -14,12 +14,12 @@ pub(crate) mod fixslice; use crate::Block; use cipher::{ - consts::{U16, U24, U32}, - crypto_common::WeakKeyError, - inout::InOut, AlgorithmName, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U16, U24, U32}, + crypto_common::WeakKeyError, + inout::InOut, }; use core::fmt; use fixslice::{BatchBlocks, FixsliceBlocks, FixsliceKeys128, FixsliceKeys192, FixsliceKeys256}; diff --git a/aes/src/soft/fixslice32.rs b/aes/src/soft/fixslice32.rs index 66291aeb..4defe52b 100644 --- a/aes/src/soft/fixslice32.rs +++ b/aes/src/soft/fixslice32.rs @@ -1374,8 +1374,8 @@ fn rotate_rows_and_columns_2_2(x: u32) -> u32 { #[cfg(feature = "hazmat")] pub(crate) mod hazmat { use super::{ - bitslice, inv_bitslice, inv_mix_columns_0, inv_shift_rows_1, inv_sub_bytes, mix_columns_0, - shift_rows_1, sub_bytes, sub_bytes_nots, State, + State, bitslice, inv_bitslice, inv_mix_columns_0, inv_shift_rows_1, inv_sub_bytes, + mix_columns_0, shift_rows_1, sub_bytes, sub_bytes_nots, }; use crate::hazmat::{Block, Block8}; diff --git a/aes/src/soft/fixslice64.rs b/aes/src/soft/fixslice64.rs index e183c5bd..c77a5b98 100644 --- a/aes/src/soft/fixslice64.rs +++ b/aes/src/soft/fixslice64.rs @@ -1429,8 +1429,8 @@ fn rotate_rows_and_columns_2_2(x: u64) -> u64 { #[cfg(feature = "hazmat")] pub(crate) mod hazmat { use super::{ - bitslice, inv_bitslice, inv_mix_columns_0, inv_shift_rows_1, inv_sub_bytes, mix_columns_0, - shift_rows_1, sub_bytes, sub_bytes_nots, State, + State, bitslice, inv_bitslice, inv_mix_columns_0, inv_shift_rows_1, inv_sub_bytes, + mix_columns_0, shift_rows_1, sub_bytes, sub_bytes_nots, }; use crate::hazmat::{Block, Block8}; diff --git a/aria/Cargo.toml b/aria/Cargo.toml index 60cc9c7b..379e7838 100644 --- a/aria/Cargo.toml +++ b/aria/Cargo.toml @@ -4,8 +4,8 @@ version = "0.2.0-pre" description = "Pure Rust implementation of the ARIA Encryption Algorithm" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/aria" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "aria", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/aria/src/aria128.rs b/aria/src/aria128.rs index a56f61c5..3f3d2276 100644 --- a/aria/src/aria128.rs +++ b/aria/src/aria128.rs @@ -1,9 +1,9 @@ use crate::{ + Aria128, consts::{C1, C2, C3}, utils::{a, fe, fo}, - Aria128, }; -use cipher::{consts::U16, AlgorithmName, Key, KeyInit, KeySizeUser}; +use cipher::{AlgorithmName, Key, KeyInit, KeySizeUser, consts::U16}; use core::fmt; impl KeySizeUser for Aria128 { diff --git a/aria/src/aria192.rs b/aria/src/aria192.rs index 9e9218d4..ed3f5e8f 100644 --- a/aria/src/aria192.rs +++ b/aria/src/aria192.rs @@ -1,9 +1,9 @@ use crate::{ + Aria192, consts::{C1, C2, C3}, utils::{a, fe, fo}, - Aria192, }; -use cipher::{consts::U24, AlgorithmName, Key, KeyInit, KeySizeUser}; +use cipher::{AlgorithmName, Key, KeyInit, KeySizeUser, consts::U24}; use core::fmt; impl KeySizeUser for Aria192 { diff --git a/aria/src/aria256.rs b/aria/src/aria256.rs index 728792e7..1c2bf454 100644 --- a/aria/src/aria256.rs +++ b/aria/src/aria256.rs @@ -1,9 +1,9 @@ use crate::{ + Aria256, consts::{C1, C2, C3}, utils::{a, fe, fo}, - Aria256, }; -use cipher::{consts::U32, AlgorithmName, Key, KeyInit, KeySizeUser}; +use cipher::{AlgorithmName, Key, KeyInit, KeySizeUser, consts::U32}; use core::fmt; impl KeySizeUser for Aria256 { diff --git a/aria/src/lib.rs b/aria/src/lib.rs index 3444f9c8..dd8b228a 100644 --- a/aria/src/lib.rs +++ b/aria/src/lib.rs @@ -43,10 +43,10 @@ mod consts; pub use cipher; use cipher::{ - consts::{U1, U16}, - inout::InOut, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, ParBlocksSizeUser, + consts::{U1, U16}, + inout::InOut, }; #[cfg(feature = "zeroize")] diff --git a/belt-block/Cargo.toml b/belt-block/Cargo.toml index a8366fb1..19917470 100644 --- a/belt-block/Cargo.toml +++ b/belt-block/Cargo.toml @@ -4,19 +4,19 @@ version = "0.2.0-pre.2" description = "belt-block block cipher implementation" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -rust-version = "1.65" -edition = "2021" +rust-version = "1.85" +edition = "2024" readme = "README.md" documentation = "https://docs.rs/belt-block" repository = "https://github.com/RustCrypto/block-ciphers" keywords = ["crypto", "belt-block", "belt", "stb"] [dependencies] -cipher = { version = "=0.5.0-pre.7", optional = true } +cipher = { version = "=0.5.0-pre.8", optional = true } [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] default = ["cipher"] diff --git a/belt-block/src/cipher_impl.rs b/belt-block/src/cipher_impl.rs index 4afaf770..023b7dba 100644 --- a/belt-block/src/cipher_impl.rs +++ b/belt-block/src/cipher_impl.rs @@ -1,9 +1,9 @@ -use crate::{belt_block_raw, from_u32, g13, g21, g5, key_idx, to_u32}; +use crate::{belt_block_raw, from_u32, g5, g13, g21, key_idx, to_u32}; use cipher::{ - consts::{U1, U16, U32}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U16, U32}, }; use core::{fmt, mem::swap, num::Wrapping}; diff --git a/belt-block/src/lib.rs b/belt-block/src/lib.rs index cc7ae331..4ad79905 100644 --- a/belt-block/src/lib.rs +++ b/belt-block/src/lib.rs @@ -24,7 +24,7 @@ #[cfg(feature = "cipher")] pub use cipher; -use crate::consts::{H13, H21, H29, H5}; +use crate::consts::{H5, H13, H21, H29}; use core::{mem::swap, num::Wrapping}; #[cfg(feature = "cipher")] @@ -113,7 +113,7 @@ pub fn belt_wblock_enc(data: &mut [u8], key: &[u32; 8]) -> Result<(), InvalidLen } let len = data.len(); - let n = (len + BLOCK_SIZE - 1) / BLOCK_SIZE; + let n = len.div_ceil(BLOCK_SIZE); for i in 1..(2 * n + 1) { let s = data[..len - 1] .chunks_exact(BLOCK_SIZE) @@ -141,7 +141,7 @@ pub fn belt_wblock_dec(data: &mut [u8], key: &[u32; 8]) -> Result<(), InvalidLen } let len = data.len(); - let n = (len + BLOCK_SIZE - 1) / BLOCK_SIZE; + let n = len.div_ceil(BLOCK_SIZE); for i in (1..(2 * n + 1)).rev() { let tail_pos = len - BLOCK_SIZE; let s = Block::try_from(&data[tail_pos..]).unwrap(); diff --git a/belt-block/tests/mod.rs b/belt-block/tests/mod.rs index ff649dc7..b94c5ebf 100644 --- a/belt-block/tests/mod.rs +++ b/belt-block/tests/mod.rs @@ -1,11 +1,11 @@ //! Example vectors from STB 34.101.31 (2020): //! http://apmi.bsu.by/assets/files/std/belt-spec371.pdf -use belt_block::{belt_block_raw, belt_wblock_dec, belt_wblock_enc}; #[cfg(feature = "cipher")] use belt_block::{ - cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}, BeltBlock, + cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}, }; +use belt_block::{belt_block_raw, belt_wblock_dec, belt_wblock_enc}; use hex_literal::hex; #[test] diff --git a/blowfish/Cargo.toml b/blowfish/Cargo.toml index 2e158df9..73d3a043 100644 --- a/blowfish/Cargo.toml +++ b/blowfish/Cargo.toml @@ -4,8 +4,8 @@ version = "0.10.0-pre.2" description = "Blowfish block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/blowfish" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "blowfish", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" byteorder = { version = "1.1", default-features = false } [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } [features] bcrypt = [] diff --git a/blowfish/src/lib.rs b/blowfish/src/lib.rs index c3967642..9f53af0b 100644 --- a/blowfish/src/lib.rs +++ b/blowfish/src/lib.rs @@ -21,12 +21,12 @@ pub use cipher; -use byteorder::{ByteOrder, BE, LE}; +use byteorder::{BE, ByteOrder, LE}; use cipher::{ - consts::{U1, U56, U8}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U56}, }; use core::fmt; use core::marker::PhantomData; diff --git a/camellia/Cargo.toml b/camellia/Cargo.toml index d56518f5..5a51358e 100644 --- a/camellia/Cargo.toml +++ b/camellia/Cargo.toml @@ -4,8 +4,8 @@ version = "0.2.0-pre" description = "Camellia block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/camellia" repository = "https://github.com/RustCrypto/block-ciphers" @@ -14,10 +14,10 @@ categories = ["cryptography", "no-std"] [dependencies] byteorder = { version = "1.1", default-features = false } -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } [features] zeroize = ["cipher/zeroize"] diff --git a/camellia/src/camellia128.rs b/camellia/src/camellia128.rs index 23b81ca5..fa58f920 100644 --- a/camellia/src/camellia128.rs +++ b/camellia/src/camellia128.rs @@ -1,6 +1,6 @@ use crate::{ - utils::{gen_subkeys26, set_ka}, Camellia128, + utils::{gen_subkeys26, set_ka}, }; use cipher::{AlgorithmName, Key, KeyInit}; use core::{fmt, marker::PhantomData}; diff --git a/camellia/src/camellia192.rs b/camellia/src/camellia192.rs index a842dfda..42704c70 100644 --- a/camellia/src/camellia192.rs +++ b/camellia/src/camellia192.rs @@ -1,6 +1,6 @@ use crate::{ - utils::{get_subkeys34, set_ka, set_kb}, Camellia192, + utils::{get_subkeys34, set_ka, set_kb}, }; use cipher::{AlgorithmName, Key, KeyInit}; use core::{fmt, marker::PhantomData}; diff --git a/camellia/src/camellia256.rs b/camellia/src/camellia256.rs index 9289683e..767d3264 100644 --- a/camellia/src/camellia256.rs +++ b/camellia/src/camellia256.rs @@ -1,6 +1,6 @@ use crate::{ - utils::{get_subkeys34, set_ka, set_kb}, Camellia256, + utils::{get_subkeys34, set_ka, set_kb}, }; use cipher::{AlgorithmName, Key, KeyInit}; use core::{fmt, marker::PhantomData}; diff --git a/camellia/src/lib.rs b/camellia/src/lib.rs index da8af86a..7f15618d 100644 --- a/camellia/src/lib.rs +++ b/camellia/src/lib.rs @@ -46,6 +46,7 @@ use core::marker::PhantomData; pub use cipher; use cipher::{ + Block, BlockSizeUser, KeySizeUser, ParBlocksSizeUser, array::ArraySize, block::{ BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, @@ -53,7 +54,6 @@ use cipher::{ }, consts::{U1, U16, U24, U32}, inout::InOut, - Block, BlockSizeUser, KeySizeUser, ParBlocksSizeUser, }; #[cfg(feature = "zeroize")] diff --git a/cast5/Cargo.toml b/cast5/Cargo.toml index eab8ffa3..24afae45 100644 --- a/cast5/Cargo.toml +++ b/cast5/Cargo.toml @@ -4,8 +4,8 @@ version = "0.12.0-pre" description = "CAST5 block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/cast5" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "cast5", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/cast5/src/lib.rs b/cast5/src/lib.rs index d4403ab7..9ddd8ec1 100644 --- a/cast5/src/lib.rs +++ b/cast5/src/lib.rs @@ -44,10 +44,10 @@ mod consts; mod schedule; use cipher::{ - consts::{U1, U16, U8}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U16}, }; use core::fmt; diff --git a/cast6/Cargo.toml b/cast6/Cargo.toml index 8448b19f..eac3f9b7 100644 --- a/cast6/Cargo.toml +++ b/cast6/Cargo.toml @@ -4,8 +4,8 @@ version = "0.2.0-pre" description = "CAST6 block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/cast6" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "cast6", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/cast6/src/lib.rs b/cast6/src/lib.rs index 6febf9c1..47f06ea6 100644 --- a/cast6/src/lib.rs +++ b/cast6/src/lib.rs @@ -43,10 +43,10 @@ pub use cipher; mod consts; use cipher::{ - consts::{U1, U16, U32}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U16, U32}, }; use core::fmt; diff --git a/des/Cargo.toml b/des/Cargo.toml index 550d5441..349751a4 100644 --- a/des/Cargo.toml +++ b/des/Cargo.toml @@ -4,8 +4,8 @@ version = "0.9.0-pre.2" description = "DES and Triple DES (3DES, TDES) block ciphers implementation" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/des" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "des", "tdes", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/des/src/des.rs b/des/src/des.rs index 90052aa2..acee7a46 100644 --- a/des/src/des.rs +++ b/des/src/des.rs @@ -3,11 +3,11 @@ #![allow(clippy::unreadable_literal)] use cipher::{ - consts::{U1, U8}, - crypto_common::WeakKeyError, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8}, + crypto_common::WeakKeyError, }; use core::fmt; diff --git a/des/src/tdes.rs b/des/src/tdes.rs index 45812b9b..5126e2ae 100644 --- a/des/src/tdes.rs +++ b/des/src/tdes.rs @@ -1,12 +1,12 @@ //! Triple DES (3DES) block ciphers. -use crate::{utils::gen_keys, Des}; +use crate::{Des, utils::gen_keys}; use cipher::{ - consts::{U1, U16, U24, U8}, - crypto_common::WeakKeyError, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U16, U24}, + crypto_common::WeakKeyError, }; use core::fmt; diff --git a/gift/Cargo.toml b/gift/Cargo.toml index ddc5c927..71ac2918 100644 --- a/gift/Cargo.toml +++ b/gift/Cargo.toml @@ -4,8 +4,8 @@ version = "0.0.1-pre.0" description = "Pure Rust implementation of the Gift block cipher" authors = ["RustCrypto Developers", "Schmid7k"] license = "MIT OR Apache-2.0" -rust-version = "1.65" -edition = "2021" +rust-version = "1.85" +edition = "2024" readme = "README.md" documentation = "https://docs.rs/gift-cipher" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "gift", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/gift/benches/gift128enc.rs b/gift/benches/gift128enc.rs index 2163ae71..e7c2f7aa 100644 --- a/gift/benches/gift128enc.rs +++ b/gift/benches/gift128enc.rs @@ -1,7 +1,7 @@ #![feature(test)] extern crate test; -use cipher::{block_decryptor_bench, block_encryptor_bench, KeyInit}; +use cipher::{KeyInit, block_decryptor_bench, block_encryptor_bench}; use gift_cipher::Gift128; block_encryptor_bench!( diff --git a/gift/src/lib.rs b/gift/src/lib.rs index cf9ffb62..2c44b655 100644 --- a/gift/src/lib.rs +++ b/gift/src/lib.rs @@ -42,10 +42,10 @@ #![warn(missing_docs, rust_2018_idioms)] use cipher::{ - consts::{U1, U16}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U16}, }; use core::fmt; diff --git a/gift/tests/mod.rs b/gift/tests/mod.rs index 087da0d4..8fc43481 100644 --- a/gift/tests/mod.rs +++ b/gift/tests/mod.rs @@ -1,4 +1,4 @@ -use cipher::{array::Array, BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}; +use cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit, array::Array}; use gift_cipher::Gift128; use hex_literal::hex; diff --git a/idea/Cargo.toml b/idea/Cargo.toml index 9b955228..ffa0f9ea 100644 --- a/idea/Cargo.toml +++ b/idea/Cargo.toml @@ -4,8 +4,8 @@ version = "0.6.0-pre" description = "IDEA block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/idea" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,10 +13,10 @@ keywords = ["crypto", "idea", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } [features] zeroize = ["cipher/zeroize"] diff --git a/idea/src/lib.rs b/idea/src/lib.rs index aac7d999..9a64bfe6 100644 --- a/idea/src/lib.rs +++ b/idea/src/lib.rs @@ -23,10 +23,10 @@ pub use cipher; use cipher::{ - consts::{U1, U16, U8}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U16}, }; use core::fmt; diff --git a/kuznyechik/Cargo.toml b/kuznyechik/Cargo.toml index acd09546..6ab9dba7 100644 --- a/kuznyechik/Cargo.toml +++ b/kuznyechik/Cargo.toml @@ -4,8 +4,8 @@ version = "0.9.0-pre.2" description = "Kuznyechik (GOST R 34.12-2015) block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/kuznyechik" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,12 +13,12 @@ keywords = ["crypto", "kuznyechik", "gost", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" cfg-if = "1" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/kuznyechik/src/big_soft/backends.rs b/kuznyechik/src/big_soft/backends.rs index a00e806c..ca4b5bbf 100644 --- a/kuznyechik/src/big_soft/backends.rs +++ b/kuznyechik/src/big_soft/backends.rs @@ -1,12 +1,12 @@ use crate::{ + Block, Key, consts::{P, P_INV}, - fused_tables::{Table, DEC_TABLE, ENC_TABLE}, + fused_tables::{DEC_TABLE, ENC_TABLE, Table}, utils::KEYGEN, - Block, Key, }; use cipher::{ - consts, Array, BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, InOut, ParBlocks, - ParBlocksSizeUser, + Array, BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, InOut, ParBlocks, + ParBlocksSizeUser, consts, }; pub(super) type RoundKeys = [u128; 10]; diff --git a/kuznyechik/src/big_soft/mod.rs b/kuznyechik/src/big_soft/mod.rs index d3c0833c..2538b09c 100644 --- a/kuznyechik/src/big_soft/mod.rs +++ b/kuznyechik/src/big_soft/mod.rs @@ -5,7 +5,7 @@ use cipher::{ mod backends; -use backends::{expand_enc_keys, inv_enc_keys, DecBackend, EncBackend, RoundKeys}; +use backends::{DecBackend, EncBackend, RoundKeys, expand_enc_keys, inv_enc_keys}; #[derive(Clone)] pub(crate) struct EncDecKeys { diff --git a/kuznyechik/src/compact_soft/backends.rs b/kuznyechik/src/compact_soft/backends.rs index eb5ba4c5..997f6971 100644 --- a/kuznyechik/src/compact_soft/backends.rs +++ b/kuznyechik/src/compact_soft/backends.rs @@ -1,10 +1,10 @@ use crate::{ - consts::{P, P_INV}, - utils::{l_step, KEYGEN}, Block, Key, + consts::{P, P_INV}, + utils::{KEYGEN, l_step}, }; use cipher::{ - consts, BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, InOut, ParBlocksSizeUser, + BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, InOut, ParBlocksSizeUser, consts, }; pub(super) type RoundKeys = [Block; 10]; diff --git a/kuznyechik/src/compact_soft/mod.rs b/kuznyechik/src/compact_soft/mod.rs index 9fe6b724..dd6d5ade 100644 --- a/kuznyechik/src/compact_soft/mod.rs +++ b/kuznyechik/src/compact_soft/mod.rs @@ -5,7 +5,7 @@ use cipher::{ mod backends; -use backends::{expand, DecBackend, EncBackend, RoundKeys}; +use backends::{DecBackend, EncBackend, RoundKeys, expand}; #[derive(Clone)] pub(crate) struct EncDecKeys(RoundKeys); diff --git a/kuznyechik/src/fused_tables.rs b/kuznyechik/src/fused_tables.rs index 1371df8f..7812b294 100644 --- a/kuznyechik/src/fused_tables.rs +++ b/kuznyechik/src/fused_tables.rs @@ -1,6 +1,6 @@ use crate::{ consts, - gft::{GFT_133, GFT_148, GFT_16, GFT_192, GFT_194, GFT_251, GFT_32}, + gft::{GFT_16, GFT_32, GFT_133, GFT_148, GFT_192, GFT_194, GFT_251}, utils::Align16, }; diff --git a/kuznyechik/src/lib.rs b/kuznyechik/src/lib.rs index 27280153..ce93753a 100644 --- a/kuznyechik/src/lib.rs +++ b/kuznyechik/src/lib.rs @@ -33,14 +33,14 @@ pub use cipher; use cipher::{ + AlgorithmName, BlockSizeUser, KeyInit, KeySizeUser, array::Array, consts::{U16, U32}, - AlgorithmName, BlockSizeUser, KeyInit, KeySizeUser, }; use core::fmt; #[cfg(feature = "zeroize")] -use cipher::zeroize::{zeroize_flat_type, ZeroizeOnDrop}; +use cipher::zeroize::{ZeroizeOnDrop, zeroize_flat_type}; mod consts; pub(crate) mod gft; diff --git a/kuznyechik/src/neon/backends.rs b/kuznyechik/src/neon/backends.rs index 7b2a49df..5cfe25c6 100644 --- a/kuznyechik/src/neon/backends.rs +++ b/kuznyechik/src/neon/backends.rs @@ -1,12 +1,14 @@ +#![allow(unsafe_op_in_unsafe_fn)] + use crate::{ + Block, Key, consts::{P, P_INV}, - fused_tables::{Table, DEC_TABLE, ENC_TABLE}, + fused_tables::{DEC_TABLE, ENC_TABLE, Table}, utils::KEYGEN, - Block, Key, }; use cipher::{ - consts, typenum::Unsigned, BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, InOut, - ParBlocks, ParBlocksSizeUser, + BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, InOut, ParBlocks, + ParBlocksSizeUser, consts, typenum::Unsigned, }; use core::arch::aarch64::*; diff --git a/kuznyechik/src/neon/mod.rs b/kuznyechik/src/neon/mod.rs index 413258f1..1a56575c 100644 --- a/kuznyechik/src/neon/mod.rs +++ b/kuznyechik/src/neon/mod.rs @@ -5,7 +5,7 @@ use cipher::{ mod backends; -use backends::{expand_enc_keys, inv_enc_keys, DecBackend, EncBackend, RoundKeys}; +use backends::{DecBackend, EncBackend, RoundKeys, expand_enc_keys, inv_enc_keys}; #[derive(Clone)] pub(crate) struct EncDecKeys { diff --git a/kuznyechik/src/sse2/backends.rs b/kuznyechik/src/sse2/backends.rs index ffa9a97b..e4d7a63b 100644 --- a/kuznyechik/src/sse2/backends.rs +++ b/kuznyechik/src/sse2/backends.rs @@ -1,14 +1,16 @@ +#![allow(unsafe_op_in_unsafe_fn)] + use crate::{ + Block, Key, consts::{P, P_INV}, - fused_tables::{Table, DEC_TABLE, ENC_TABLE}, + fused_tables::{DEC_TABLE, ENC_TABLE, Table}, utils::KEYGEN, - Block, Key, }; use cipher::{ - consts::{U16, U4}, + BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, ParBlocks, ParBlocksSizeUser, + consts::{U4, U16}, inout::InOut, typenum::Unsigned, - BlockCipherDecBackend, BlockCipherEncBackend, BlockSizeUser, ParBlocks, ParBlocksSizeUser, }; #[cfg(target_arch = "x86")] diff --git a/kuznyechik/src/sse2/mod.rs b/kuznyechik/src/sse2/mod.rs index 566ddcf1..4135009c 100644 --- a/kuznyechik/src/sse2/mod.rs +++ b/kuznyechik/src/sse2/mod.rs @@ -7,7 +7,7 @@ use cipher::{ mod backends; -use backends::{expand_enc_keys, inv_enc_keys, DecBackend, EncBackend, RoundKeys}; +use backends::{DecBackend, EncBackend, RoundKeys, expand_enc_keys, inv_enc_keys}; #[derive(Clone)] pub(crate) struct EncDecKeys { diff --git a/kuznyechik/src/utils.rs b/kuznyechik/src/utils.rs index dd29c252..dd848ba7 100644 --- a/kuznyechik/src/utils.rs +++ b/kuznyechik/src/utils.rs @@ -1,4 +1,4 @@ -use crate::gft::{GFT_133, GFT_148, GFT_16, GFT_192, GFT_194, GFT_251, GFT_32}; +use crate::gft::{GFT_16, GFT_32, GFT_133, GFT_148, GFT_192, GFT_194, GFT_251}; #[inline(always)] const fn get_idx(b: usize, i: usize) -> usize { diff --git a/magma/Cargo.toml b/magma/Cargo.toml index cac7c2ff..de166ebb 100644 --- a/magma/Cargo.toml +++ b/magma/Cargo.toml @@ -4,8 +4,8 @@ version = "0.10.0-pre.2" description = "Magma (GOST R 34.12-2015) block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/magma" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "magma", "gost", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/magma/src/lib.rs b/magma/src/lib.rs index 15a337ba..9ef8d891 100644 --- a/magma/src/lib.rs +++ b/magma/src/lib.rs @@ -47,10 +47,10 @@ pub use cipher; use cipher::{ - consts::{U1, U32, U8}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U32}, }; use core::{fmt, marker::PhantomData}; diff --git a/rc2/Cargo.toml b/rc2/Cargo.toml index ba494f7c..ed74d73f 100644 --- a/rc2/Cargo.toml +++ b/rc2/Cargo.toml @@ -4,8 +4,8 @@ version = "0.9.0-pre" description = "RC2 block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/rc2" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,10 +13,10 @@ keywords = ["crypto", "rc2", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } [features] zeroize = ["cipher/zeroize"] diff --git a/rc2/src/lib.rs b/rc2/src/lib.rs index 01bd2c93..8aeb9326 100644 --- a/rc2/src/lib.rs +++ b/rc2/src/lib.rs @@ -22,10 +22,10 @@ pub use cipher; use cipher::{ - consts::{U1, U32, U8}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U32}, }; use core::fmt; diff --git a/rc5/Cargo.toml b/rc5/Cargo.toml index f63160b0..fd017a1a 100644 --- a/rc5/Cargo.toml +++ b/rc5/Cargo.toml @@ -3,20 +3,20 @@ name = "rc5" version = "0.1.0-pre" description = "RC5 block cipher" authors = ["RustCrypto Developers"] -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" -rust-version = "1.65" +rust-version = "1.85" readme = "README.md" repository = "https://github.com/RustCrypto/block-ciphers" keywords = ["crypto", "rc5", "block-cipher"] categories = ["cryptography"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/rc5/src/lib.rs b/rc5/src/lib.rs index 1a84520f..1d76c1b2 100644 --- a/rc5/src/lib.rs +++ b/rc5/src/lib.rs @@ -19,14 +19,14 @@ #![warn(missing_docs, rust_2018_idioms)] use cipher::{ + AlgorithmName, Array, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, + BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, KeyInit, + KeySizeUser, ParBlocksSizeUser, array::ArraySize, consts::{U1, U2, U256}, crypto_common::BlockSizes, inout::InOut, typenum::{Diff, IsLess, Le, NonZero, Sum, Unsigned}, - AlgorithmName, Array, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, - BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, KeyInit, - KeySizeUser, ParBlocksSizeUser, }; use core::{ cmp::max, diff --git a/rc5/src/primitives.rs b/rc5/src/primitives.rs index bd09b0f2..d3a49d11 100644 --- a/rc5/src/primitives.rs +++ b/rc5/src/primitives.rs @@ -3,7 +3,7 @@ use core::ops::{Add, BitXor, Mul}; use cipher::{ array::{Array, ArraySize}, crypto_common::BlockSizes, - typenum::{Diff, Prod, Quot, Sum, U1, U16, U2, U4, U8}, + typenum::{Diff, Prod, Quot, Sum, U1, U2, U4, U8, U16}, }; pub type BlockSize = Prod<::Bytes, U2>; diff --git a/serpent/Cargo.toml b/serpent/Cargo.toml index d51a6217..5bfd84a6 100644 --- a/serpent/Cargo.toml +++ b/serpent/Cargo.toml @@ -4,8 +4,8 @@ version = "0.6.0-pre" description = "Serpent block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/serpent" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,10 +13,10 @@ keywords = ["crypto", "serpent", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } [features] zeroize = ["cipher/zeroize"] diff --git a/serpent/src/lib.rs b/serpent/src/lib.rs index d6bb553c..f2dbf79a 100644 --- a/serpent/src/lib.rs +++ b/serpent/src/lib.rs @@ -23,10 +23,10 @@ pub use cipher; use cipher::{ - consts::{U1, U16}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U16}, }; use core::fmt; diff --git a/sm4/Cargo.toml b/sm4/Cargo.toml index f07cea32..a6095dfc 100644 --- a/sm4/Cargo.toml +++ b/sm4/Cargo.toml @@ -4,8 +4,8 @@ version = "0.6.0-pre" description = "SM4 block cipher algorithm" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/sm4" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "sm4", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/sm4/src/lib.rs b/sm4/src/lib.rs index c6cd2f8b..26f8c64d 100644 --- a/sm4/src/lib.rs +++ b/sm4/src/lib.rs @@ -22,10 +22,10 @@ pub use cipher; use cipher::{ - consts::{U1, U16}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U16}, }; use core::fmt; diff --git a/speck/Cargo.toml b/speck/Cargo.toml index 81a29ef6..53f499b0 100644 --- a/speck/Cargo.toml +++ b/speck/Cargo.toml @@ -7,17 +7,17 @@ description = "Speck block cipher algorithm" documentation = "https://docs.rs/speck" repository = "https://github.com/RustCrypto/block-ciphers/tree/master/speck" readme = "README.md" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" keywords = ["crypto", "speck", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/speck/src/lib.rs b/speck/src/lib.rs index b59e63a1..a87383ac 100644 --- a/speck/src/lib.rs +++ b/speck/src/lib.rs @@ -14,9 +14,9 @@ pub use cipher; use cipher::{ - consts::*, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, - BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, - BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, + BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, + KeyInit, KeySizeUser, ParBlocksSizeUser, consts::*, }; use core::{fmt, mem::size_of}; diff --git a/speck/tests/mod.rs b/speck/tests/mod.rs index 0f1e1450..bda26f68 100644 --- a/speck/tests/mod.rs +++ b/speck/tests/mod.rs @@ -3,8 +3,8 @@ use cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}; use hex_literal::hex; use speck_cipher::{ - Speck128_128, Speck128_192, Speck128_256, Speck32_64, Speck48_72, Speck48_96, Speck64_128, - Speck64_96, Speck96_144, Speck96_96, + Speck32_64, Speck48_72, Speck48_96, Speck64_96, Speck64_128, Speck96_96, Speck96_144, + Speck128_128, Speck128_192, Speck128_256, }; macro_rules! new_test { diff --git a/threefish/Cargo.toml b/threefish/Cargo.toml index f643d457..d0b41ffe 100644 --- a/threefish/Cargo.toml +++ b/threefish/Cargo.toml @@ -4,8 +4,8 @@ version = "0.6.0-pre" description = "Threefish block cipher" authors = ["The Rust-Crypto Project Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/threefish" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,12 +13,12 @@ keywords = ["crypto", "threefish", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = { version = "=0.5.0-pre.7", optional = true } +cipher = { version = "=0.5.0-pre.8", optional = true } zeroize = { version = "1.6", optional = true, default-features = false } [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] default = ["cipher"] diff --git a/threefish/benches/mod.rs b/threefish/benches/mod.rs index 47cbdb9d..84f2d33c 100644 --- a/threefish/benches/mod.rs +++ b/threefish/benches/mod.rs @@ -2,7 +2,7 @@ extern crate test; use cipher::{block_decryptor_bench, block_encryptor_bench}; -use threefish::{Threefish1024, Threefish256, Threefish512}; +use threefish::{Threefish256, Threefish512, Threefish1024}; block_encryptor_bench!( Key: Threefish256, diff --git a/threefish/src/lib.rs b/threefish/src/lib.rs index 97ff9dc1..5c7b3c58 100644 --- a/threefish/src/lib.rs +++ b/threefish/src/lib.rs @@ -26,15 +26,15 @@ use core::fmt; #[cfg(feature = "cipher")] use cipher::{ - consts::{U1, U128, U32, U64}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U32, U64, U128}, }; mod consts; -use crate::consts::{C240, P1024, P256, P512, R1024, R256, R512}; +use crate::consts::{C240, P256, P512, P1024, R256, R512, R1024}; #[cfg(feature = "zeroize")] use zeroize::{Zeroize, ZeroizeOnDrop}; diff --git a/threefish/tests/mod.rs b/threefish/tests/mod.rs index 7238e1e4..47f5ff61 100644 --- a/threefish/tests/mod.rs +++ b/threefish/tests/mod.rs @@ -3,7 +3,7 @@ #![cfg(feature = "cipher")] use cipher::{Block, BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}; use hex_literal::hex; -use threefish::{Threefish1024, Threefish256, Threefish512}; +use threefish::{Threefish256, Threefish512, Threefish1024}; struct Vector { key: &'static [u8], diff --git a/twofish/Cargo.toml b/twofish/Cargo.toml index 5eef4f35..c2d98d2a 100644 --- a/twofish/Cargo.toml +++ b/twofish/Cargo.toml @@ -4,8 +4,8 @@ version = "0.8.0-pre" description = "Twofish block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/twofish" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,11 +13,11 @@ keywords = ["crypto", "twofish", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } -hex-literal = "0.4" +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } +hex-literal = "1" [features] zeroize = ["cipher/zeroize"] diff --git a/twofish/src/lib.rs b/twofish/src/lib.rs index 4a6b7abf..554e124b 100644 --- a/twofish/src/lib.rs +++ b/twofish/src/lib.rs @@ -23,10 +23,10 @@ pub use cipher; use cipher::{ - consts::{U1, U16, U32}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U16, U32}, }; use core::fmt; diff --git a/twofish/tests/mod.rs b/twofish/tests/mod.rs index 7d8f2039..eadd1cd0 100644 --- a/twofish/tests/mod.rs +++ b/twofish/tests/mod.rs @@ -1,4 +1,4 @@ -use cipher::{array::Array, BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}; +use cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit, array::Array}; use hex_literal::hex; use twofish::Twofish; diff --git a/xtea/Cargo.toml b/xtea/Cargo.toml index dc451c5f..ccb06610 100644 --- a/xtea/Cargo.toml +++ b/xtea/Cargo.toml @@ -4,8 +4,8 @@ version = "0.0.1-pre.0" description = "XTEA block cipher" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +edition = "2024" +rust-version = "1.85" readme = "README.md" documentation = "https://docs.rs/xtea" repository = "https://github.com/RustCrypto/block-ciphers" @@ -13,10 +13,10 @@ keywords = ["crypto", "xtea", "block-cipher"] categories = ["cryptography", "no-std"] [dependencies] -cipher = "=0.5.0-pre.7" +cipher = "=0.5.0-pre.8" [dev-dependencies] -cipher = { version = "=0.5.0-pre.7", features = ["dev"] } +cipher = { version = "=0.5.0-pre.8", features = ["dev"] } [features] zeroize = ["cipher/zeroize"] diff --git a/xtea/src/lib.rs b/xtea/src/lib.rs index cfadc981..f73ef1ca 100644 --- a/xtea/src/lib.rs +++ b/xtea/src/lib.rs @@ -22,10 +22,10 @@ pub use cipher; use cipher::{ - consts::{U1, U16, U8}, AlgorithmName, Block, BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, InOut, InvalidLength, Key, KeyInit, KeySizeUser, ParBlocksSizeUser, + consts::{U1, U8, U16}, }; use core::fmt; diff --git a/xtea/tests/mod.rs b/xtea/tests/mod.rs index 85922ab4..0b266bb6 100644 --- a/xtea/tests/mod.rs +++ b/xtea/tests/mod.rs @@ -1,4 +1,4 @@ -use cipher::{array::Array, BlockCipherDecrypt, BlockCipherEncrypt, KeyInit}; +use cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit, array::Array}; use xtea::Xtea; #[test]