From b6f424f23891ed08ba3ae61958f83fd781572d5c Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:28:42 -0800 Subject: [PATCH 01/17] use pre-release versions of hashes & MACs --- .github/workflows/workspace.yml | 2 +- Cargo.toml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 5005c97..ea7305d 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.81.0 + toolchain: 1.85.0 components: clippy - run: cargo clippy --all -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index 93fc126..83092cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,11 @@ members = [ [profile.dev] opt-level = 2 + +[patch.crates-io] +belt-hash = { git = "https://github.com/RustCrypto/hashes.git" } +sha1 = { git = "https://github.com/RustCrypto/hashes.git" } +sha2 = { git = "https://github.com/RustCrypto/hashes.git" } + +hmac = { git = "https://github.com/RustCrypto/MACs.git" } +cmac = { git = "https://github.com/RustCrypto/MACs.git" } From 8fa31ff60a5cfe690566b4b90541bc3b6b961455 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:28:42 -0800 Subject: [PATCH 02/17] ansi-x963-kdf: bump to edition 2024; msrv 1.85 --- .github/workflows/ansi-x963-kdf.yml | 4 ++-- ansi-x963-kdf/Cargo.toml | 6 +++--- ansi-x963-kdf/README.md | 9 +-------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ansi-x963-kdf.yml b/.github/workflows/ansi-x963-kdf.yml index 4b7c0fc..03eb402 100644 --- a/.github/workflows/ansi-x963-kdf.yml +++ b/.github/workflows/ansi-x963-kdf.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -40,7 +40,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/ansi-x963-kdf/Cargo.toml b/ansi-x963-kdf/Cargo.toml index ede86ea..6e80748 100644 --- a/ansi-x963-kdf/Cargo.toml +++ b/ansi-x963-kdf/Cargo.toml @@ -5,15 +5,15 @@ description = "ANSI X9.63 Key Derivation Function" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2021" +edition = "2024" documentation = "https://docs.rs/ansi-x963-kdf" repository = "https://github.com/RustCrypto/KDFs" keywords = ["crypto", "ansi-x963-kdf", "KDF", "SEC1"] categories = ["cryptography", "no-std"] -rust-version = "1.81" +rust-version = "1.85" [dependencies] -digest = "=0.11.0-pre.9" +digest = "=0.11.0-pre.10" [dev-dependencies] hex-literal = "0.4" diff --git a/ansi-x963-kdf/README.md b/ansi-x963-kdf/README.md index 7a3bc7f..8f38d07 100644 --- a/ansi-x963-kdf/README.md +++ b/ansi-x963-kdf/README.md @@ -24,13 +24,6 @@ ansi_x963_kdf::derive_key_into::(b"secret", b"shared-info", &mut key).un assert_eq!(key, hex!("8dbb1d50bcc7fc782abc9db5c64a2826")); ``` -## Minimum Supported Rust Version - -Rust **1.81** or higher. - -Minimum supported Rust version can be changed in the future, but it will be -done with a minor version bump. - ## SemVer Policy - All on-by-default features of this library are covered by SemVer @@ -58,6 +51,6 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/KDFs/actions/workflows/ansi-x963-kdf.yml/badge.svg [build-link]: https://github.com/RustCrypto/KDFs/actions/workflows/ansi-x963-kdf.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs From 175694d98ebbe0574c170e6bc38d56ddec6e4c7f Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:30:23 -0800 Subject: [PATCH 03/17] bake-kdf: bump to edition 2024; msrv 1.85 --- .github/workflows/bake-kdf.yml | 4 ++-- bake-kdf/Cargo.toml | 4 ++-- bake-kdf/README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bake-kdf.yml b/.github/workflows/bake-kdf.yml index 099f577..a012fa9 100644 --- a/.github/workflows/bake-kdf.yml +++ b/.github/workflows/bake-kdf.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -40,7 +40,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/bake-kdf/Cargo.toml b/bake-kdf/Cargo.toml index f11ab3c..5d703bc 100644 --- a/bake-kdf/Cargo.toml +++ b/bake-kdf/Cargo.toml @@ -5,8 +5,8 @@ description = "bake-kdf function (STB 34.101.66-2014)" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2021" -rust-version = "1.72" +edition = "2024" +rust-version = "1.85" documentation = "https://docs.rs/bake-kdf" repository = "https://github.com/RustCrypto/KDFs" keywords = ["crypto", "bake", "stb", "kdf"] diff --git a/bake-kdf/README.md b/bake-kdf/README.md index bb044a3..0d5f625 100644 --- a/bake-kdf/README.md +++ b/bake-kdf/README.md @@ -35,6 +35,6 @@ assert_eq!(key, hex!("bbd7ece0080bee33c776a140f8d807a113a119a4e4d4270f9f2018fbd5 [build-image]: https://github.com/RustCrypto/KDFs/actions/workflows/bake-kdf.yml/badge.svg [build-link]: https://github.com/RustCrypto/KDFs/actions/workflows/bake-kdf.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs From da8eae98c8f0dc5bd5ed2cff5523f43953d28114 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:30:23 -0800 Subject: [PATCH 04/17] concat-kdf: bump to edition 2024; msrv 1.85 --- .github/workflows/concat-kdf.yml | 4 ++-- concat-kdf/Cargo.toml | 6 +++--- concat-kdf/README.md | 9 +-------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/concat-kdf.yml b/.github/workflows/concat-kdf.yml index 7f7d157..eb7faf1 100644 --- a/.github/workflows/concat-kdf.yml +++ b/.github/workflows/concat-kdf.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -40,7 +40,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/concat-kdf/Cargo.toml b/concat-kdf/Cargo.toml index b7cf056..032a33b 100644 --- a/concat-kdf/Cargo.toml +++ b/concat-kdf/Cargo.toml @@ -5,15 +5,15 @@ description = "Concatenation Key Derivation Function (Concat KDF)" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" -edition = "2021" +edition = "2024" documentation = "https://docs.rs/concat-kdf" repository = "https://github.com/RustCrypto/KDFs" keywords = ["crypto", "concat-kdf", "KDF", "NIST"] categories = ["cryptography", "no-std"] -rust-version = "1.81" +rust-version = "1.85" [dependencies] -digest = "=0.11.0-pre.9" +digest = "=0.11.0-pre.10" [dev-dependencies] hex-literal = "0.4" diff --git a/concat-kdf/README.md b/concat-kdf/README.md index 6631a45..ad1d6e2 100644 --- a/concat-kdf/README.md +++ b/concat-kdf/README.md @@ -25,13 +25,6 @@ concat_kdf::derive_key_into::(b"secret", b"shared-info", &mut key).unwra assert_eq!(key, hex!("960db2c549ab16d71a7b008e005c2bdc")); ``` -## Minimum Supported Rust Version - -Rust **1.81** or higher. - -Minimum supported Rust version can be changed in the future, but it will be -done with a minor version bump. - ## SemVer Policy - All on-by-default features of this library are covered by SemVer @@ -57,7 +50,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/concat-kdf/badge.svg [docs-link]: https://docs.rs/concat-kdf/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs [build-image]: https://github.com/RustCrypto/KDFs/workflows/concat-kdf/badge.svg?branch=master&event=push From ebc261d0ced567d1e29e2c3c27c19b76484b2cdc Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:30:23 -0800 Subject: [PATCH 05/17] hkdf: bump to edition 2024; msrv 1.85 --- .github/workflows/hkdf.yml | 4 ++-- hkdf/Cargo.toml | 4 ++-- hkdf/README.md | 9 +-------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/hkdf.yml b/.github/workflows/hkdf.yml index cc2b93e..0108975 100644 --- a/.github/workflows/hkdf.yml +++ b/.github/workflows/hkdf.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -48,7 +48,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/hkdf/Cargo.toml b/hkdf/Cargo.toml index 2347190..eab5804 100644 --- a/hkdf/Cargo.toml +++ b/hkdf/Cargo.toml @@ -9,8 +9,8 @@ description = "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)" keywords = ["crypto", "HKDF", "KDF"] categories = ["cryptography", "no-std"] readme = "README.md" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" [dependencies] hmac = "=0.13.0-pre.4" diff --git a/hkdf/README.md b/hkdf/README.md index 50412c2..d52a51c 100644 --- a/hkdf/README.md +++ b/hkdf/README.md @@ -71,13 +71,6 @@ let expected = hex!(" assert_eq!(okm, expected); ``` -## Minimum Supported Rust Version - -Rust **1.72** or higher. - -Minimum supported Rust version can be changed in the future, but it will be -done with a minor version bump. - ## SemVer Policy - All on-by-default features of this library are covered by SemVer @@ -105,7 +98,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/hkdf/badge.svg [docs-link]: https://docs.rs/hkdf/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.72+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs [build-image]: https://github.com/RustCrypto/KDFs/workflows/hkdf/badge.svg?branch=master&event=push From 11a5a382b488d225a3c4022602a16edcca46e31b Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:30:23 -0800 Subject: [PATCH 06/17] kbkdf: bump to edition 2024; msrv 1.85 --- .github/workflows/kbkdf.yml | 4 ++-- Cargo.lock | 48 ++++++++++++++++--------------------- Cargo.toml | 3 +++ kbkdf/Cargo.toml | 10 ++++---- kbkdf/README.md | 9 +------ kbkdf/tests/kbkdf/parser.rs | 8 +++---- 6 files changed, 36 insertions(+), 46 deletions(-) diff --git a/.github/workflows/kbkdf.yml b/.github/workflows/kbkdf.yml index e016b45..f426fcf 100644 --- a/.github/workflows/kbkdf.yml +++ b/.github/workflows/kbkdf.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -46,7 +46,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index d69711c..24fc96c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,12 +1,11 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aes" version = "0.9.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7856582c758ade85d71daf27ec6bcea6c1c73913692b07b8dffea2dc03531c9" +source = "git+https://github.com/RustCrypto/block-ciphers.git#bb7623cf85b416c8c61d89dd11573e6e7f961720" dependencies = [ "cfg-if", "cipher", @@ -39,8 +38,7 @@ checksum = "d9aa1eef3994e2ccd304a78fe3fea4a73e5792007f85f09b79bb82143ca5f82b" [[package]] name = "belt-hash" version = "0.2.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee5982dbf7d2f719b4237cd796ee600e9dcbef1eef460ece65380f9192a54ab5" +source = "git+https://github.com/RustCrypto/hashes.git#0d0369ff7dab69e98acfb8a08f4724dbda285e04" dependencies = [ "belt-block", "digest", @@ -54,9 +52,9 @@ checksum = "847495c209977a90e8aad588b959d0ca9f5dc228096d29a6bd3defd53f35eaec" [[package]] name = "block-buffer" -version = "0.11.0-rc.3" +version = "0.11.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +checksum = "a229bfd78e4827c91b9b95784f69492c1b77c1ab75a45a8a037b139215086f94" dependencies = [ "hybrid-array", ] @@ -69,9 +67,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cipher" -version = "0.5.0-pre.7" +version = "0.5.0-pre.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1425e6ce000f05a73096556cabcfb6a10a3ffe3bb4d75416ca8f00819c0b6a" +checksum = "276974d2acb7cf592603150941fc1ff6442acdeb1dc653ac2825928f4703c131" dependencies = [ "crypto-common", "inout", @@ -80,8 +78,7 @@ dependencies = [ [[package]] name = "cmac" version = "0.8.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a53c8815f718726c448e4e83b86806245fb37bfaa82ad50893d9f01ad3a503" +source = "git+https://github.com/RustCrypto/MACs.git#c7cbed0bd3f7026cc01251cd4602d0db4d0495b9" dependencies = [ "cipher", "dbl", @@ -108,27 +105,27 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.0-rc.1" +version = "0.2.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +checksum = "170d71b5b14dec99db7739f6fc7d6ec2db80b78c3acb77db48392ccc3d8a9ea0" dependencies = [ "hybrid-array", ] [[package]] name = "dbl" -version = "0.4.0-rc.1" +version = "0.4.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b317b5dd7fb52c79e017554049304992f65260689c5ddb55438ad52ba007f98d" +checksum = "cb24c766034b76390c67f3d9c44e63019febeb4cc39e4ba40b5fc79e20c898e1" dependencies = [ "hybrid-array", ] [[package]] name = "digest" -version = "0.11.0-pre.9" +version = "0.11.0-pre.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +checksum = "6c478574b20020306f98d61c8ca3322d762e1ff08117422ac6106438605ea516" dependencies = [ "block-buffer", "crypto-common", @@ -161,26 +158,25 @@ dependencies = [ [[package]] name = "hmac" version = "0.13.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" +source = "git+https://github.com/RustCrypto/MACs.git#c7cbed0bd3f7026cc01251cd4602d0db4d0495b9" dependencies = [ "digest", ] [[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", ] [[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", ] @@ -208,8 +204,7 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "sha1" version = "0.11.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9540978cef7a8498211c1b1c14e5ce920fe5bd524ea84f4a3d72d4602515ae93" +source = "git+https://github.com/RustCrypto/hashes.git#0d0369ff7dab69e98acfb8a08f4724dbda285e04" dependencies = [ "cfg-if", "cpufeatures", @@ -219,8 +214,7 @@ dependencies = [ [[package]] name = "sha2" version = "0.11.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +source = "git+https://github.com/RustCrypto/hashes.git#0d0369ff7dab69e98acfb8a08f4724dbda285e04" dependencies = [ "cfg-if", "cpufeatures", diff --git a/Cargo.toml b/Cargo.toml index 83092cc..b193c88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,6 @@ sha2 = { git = "https://github.com/RustCrypto/hashes.git" } hmac = { git = "https://github.com/RustCrypto/MACs.git" } cmac = { git = "https://github.com/RustCrypto/MACs.git" } + +# https://github.com/RustCrypto/block-ciphers/pull/472 +aes = { git = "https://github.com/RustCrypto/block-ciphers.git" } diff --git a/kbkdf/Cargo.toml b/kbkdf/Cargo.toml index 6fb9df0..3a675cd 100644 --- a/kbkdf/Cargo.toml +++ b/kbkdf/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kbkdf" version = "0.0.1" -edition = "2021" +edition = "2024" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" homepage = "https://github.com/RustCrypto/KDFs/tree/master/kbkdf" @@ -10,18 +10,18 @@ description = "Key Derivation Using Pseudorandom Function (KBKDF)" keywords = ["crypto", "KBKDF", "KDF"] categories = ["cryptography", "no-std"] readme = "README.md" -rust-version = "1.81" +rust-version = "1.85" exclude = ["/tests/*"] [dependencies] -digest = { version = "0.11.0-pre.9", default-features = false, features = ["mac"] } +digest = { version = "0.11.0-pre.10", default-features = false, features = ["mac"] } [dev-dependencies] hex-literal = "0.4" hex = "0.4" hmac = { version = "0.13.0-pre.4", default-features = false } -sha2 = { version = "0.11.0-pre.2", default-features = false } -sha1 = { version = "0.11.0-pre.2", default-features = false } +sha2 = { version = "0.11.0-pre.4", default-features = false } +sha1 = { version = "0.11.0-pre.4", default-features = false } cmac = "0.8.0-pre.2" aes = "0.9.0-pre.2" diff --git a/kbkdf/README.md b/kbkdf/README.md index e9551f5..c915108 100644 --- a/kbkdf/README.md +++ b/kbkdf/README.md @@ -38,13 +38,6 @@ assert_eq!( ); ``` -## Minimum Supported Rust Version - -Rust **1.81** or higher. - -Minimum supported Rust version can be changed in the future, but it will be -done with a minor version bump. - ## SemVer Policy - All on-by-default features of this library are covered by SemVer @@ -72,7 +65,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/KDFs/actions/workflows/kbkdf.yml/badge.svg [build-link]: https://github.com/RustCrypto/KDFs/actions/workflows/kbkdf.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.81+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs diff --git a/kbkdf/tests/kbkdf/parser.rs b/kbkdf/tests/kbkdf/parser.rs index ae730e0..29347b0 100644 --- a/kbkdf/tests/kbkdf/parser.rs +++ b/kbkdf/tests/kbkdf/parser.rs @@ -350,20 +350,20 @@ fn test_kbkdf(test_data: T, prf: Prf, r_len: Rlen, use_counter: boo (@inner $prf_ty:ident : ; $($r_value:expr => $r_ty:ident,)*) => {}; } - macro_rules! gen { + macro_rules! gen_test { ({ $($prf_value:expr => $prf_ty:ident,)* }, { $($l_value:expr => $l_ty:ident,)* }, { $($r_value:expr => $r_ty:ident,)* }) => { - gen!(@inner $($prf_value => $prf_ty,)* ; $($l_value => $l_ty,)* ; $($r_value => $r_ty,)*); + gen_test!(@inner $($prf_value => $prf_ty,)* ; $($l_value => $l_ty,)* ; $($r_value => $r_ty,)*); }; (@inner $next_prf_value:expr => $next_prf_ty:ident, $($prf_value:expr => $prf_ty:ident,)* ; $($l_value:expr => $l_ty:ident,)* ; $($r_value:expr => $r_ty:ident,)*) => { if prf == $next_prf_value { gen_inner!($next_prf_ty, { $($l_value => $l_ty,)* }, { $($r_value => $r_ty,)* }); } - gen!(@inner $($prf_value => $prf_ty,)* ; $($l_value => $l_ty,)* ; $($r_value => $r_ty,)*); + gen_test!(@inner $($prf_value => $prf_ty,)* ; $($l_value => $l_ty,)* ; $($r_value => $r_ty,)*); }; (@inner ; $($l_value:expr => $l_ty:ident,)* ; $($r_value:expr => $r_ty:ident,)*) => {}; } - gen!({ + gen_test!({ Prf::CmacAes128 => CmacAes128, Prf::CmacAes192 => CmacAes192, Prf::CmacAes256 => CmacAes256, From b759a15ff48c9602a8f2fb5515731229727998fc Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:40:55 -0800 Subject: [PATCH 07/17] ansi-x963-kdf: reformat with edition 2024 --- ansi-x963-kdf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansi-x963-kdf/src/lib.rs b/ansi-x963-kdf/src/lib.rs index 6d0e7bc..9d9213b 100644 --- a/ansi-x963-kdf/src/lib.rs +++ b/ansi-x963-kdf/src/lib.rs @@ -2,7 +2,7 @@ #![doc = include_str!("../README.md")] use core::fmt; -use digest::{array::typenum::Unsigned, Digest, FixedOutputReset}; +use digest::{Digest, FixedOutputReset, array::typenum::Unsigned}; /// Derives `key` in-place from `secret` and `shared_info`. /// From 4432d605a9fed92f1a08f093b67e29c5b2343ebc Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:40:55 -0800 Subject: [PATCH 08/17] bake-kdf: reformat with edition 2024 --- bake-kdf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bake-kdf/src/lib.rs b/bake-kdf/src/lib.rs index 279b0ab..d72095d 100644 --- a/bake-kdf/src/lib.rs +++ b/bake-kdf/src/lib.rs @@ -10,7 +10,7 @@ #![warn(missing_docs, rust_2018_idioms)] use belt_hash::digest::FixedOutput; -use belt_hash::{belt_compress, BeltHash, Digest}; +use belt_hash::{BeltHash, Digest, belt_compress}; /// `belt-keyexpand` key expansion algorithm described in STB 34.101.34-2020 8.1.2. /// From df5dcbdb60950eb0cc93881a1b7b57ee68cd182d Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:40:55 -0800 Subject: [PATCH 09/17] concat-kdf: reformat with edition 2024 --- concat-kdf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concat-kdf/src/lib.rs b/concat-kdf/src/lib.rs index a355bed..b2347f0 100644 --- a/concat-kdf/src/lib.rs +++ b/concat-kdf/src/lib.rs @@ -2,7 +2,7 @@ #![doc = include_str!("../README.md")] use core::fmt; -use digest::{array::typenum::Unsigned, Digest, FixedOutputReset, Update}; +use digest::{Digest, FixedOutputReset, Update, array::typenum::Unsigned}; /// Derives `key` in-place from `secret` and `other_info`. /// From ce5bc89001d2a2a51b6dc4d5164aed11fe922f37 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:40:55 -0800 Subject: [PATCH 10/17] hkdf: reformat with edition 2024 --- hkdf/src/lib.rs | 2 +- hkdf/src/sealed.rs | 2 +- hkdf/tests/rfc5869.rs | 4 ++-- hkdf/tests/wycheproof.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hkdf/src/lib.rs b/hkdf/src/lib.rs index 7ae9056..d3e17f1 100644 --- a/hkdf/src/lib.rs +++ b/hkdf/src/lib.rs @@ -100,7 +100,7 @@ pub use hmac; use core::fmt; use core::marker::PhantomData; use hmac::digest::{ - array::typenum::Unsigned, crypto_common::AlgorithmName, Output, OutputSizeUser, + Output, OutputSizeUser, array::typenum::Unsigned, crypto_common::AlgorithmName, }; use hmac::{Hmac, SimpleHmac}; diff --git a/hkdf/src/sealed.rs b/hkdf/src/sealed.rs index 1895762..e1d02f7 100644 --- a/hkdf/src/sealed.rs +++ b/hkdf/src/sealed.rs @@ -1,6 +1,6 @@ use hmac::digest::{ - core_api::{BlockSizeUser, CoreWrapper, OutputSizeUser}, Digest, FixedOutput, KeyInit, Output, Update, + core_api::{BlockSizeUser, CoreWrapper, OutputSizeUser}, }; use hmac::{EagerHash, Hmac, HmacCore, SimpleHmac}; diff --git a/hkdf/tests/rfc5869.rs b/hkdf/tests/rfc5869.rs index f4bd8d9..bef7699 100644 --- a/hkdf/tests/rfc5869.rs +++ b/hkdf/tests/rfc5869.rs @@ -1,7 +1,7 @@ use hex_literal::hex; -use hkdf::{hmac::EagerHash, Hkdf}; +use hkdf::{Hkdf, hmac::EagerHash}; use sha1::Sha1; -use sha2::{digest::OutputSizeUser, Sha256}; +use sha2::{Sha256, digest::OutputSizeUser}; struct Test<'a> { ikm: &'a [u8], diff --git a/hkdf/tests/wycheproof.rs b/hkdf/tests/wycheproof.rs index d7b45fe..30cddca 100644 --- a/hkdf/tests/wycheproof.rs +++ b/hkdf/tests/wycheproof.rs @@ -2,7 +2,7 @@ use blobby::Blob4Iterator; use hkdf::{Hkdf, HmacImpl}; use hmac::{Hmac, SimpleHmac}; use sha1::Sha1; -use sha2::{digest::OutputSizeUser, Sha256, Sha384, Sha512}; +use sha2::{Sha256, Sha384, Sha512, digest::OutputSizeUser}; fn test>(data: &[u8]) { for (i, row) in Blob4Iterator::new(data).unwrap().enumerate() { From 72147ee475a9040128bc76094a3b11b1821d9ef1 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:40:55 -0800 Subject: [PATCH 11/17] kbkdf: reformat with edition 2024 --- kbkdf/src/lib.rs | 6 +++--- kbkdf/src/sealed.rs | 4 ++-- kbkdf/tests/kbkdf/parser.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kbkdf/src/lib.rs b/kbkdf/src/lib.rs index 68fc9d4..02e1623 100644 --- a/kbkdf/src/lib.rs +++ b/kbkdf/src/lib.rs @@ -3,11 +3,11 @@ use core::{fmt, marker::PhantomData, ops::Mul}; use digest::{ - array::{typenum::Unsigned, Array, ArraySize}, - consts::{U32, U8}, + KeyInit, Mac, + array::{Array, ArraySize, typenum::Unsigned}, + consts::{U8, U32}, crypto_common::KeySizeUser, typenum::op, - KeyInit, Mac, }; pub mod sealed; diff --git a/kbkdf/src/sealed.rs b/kbkdf/src/sealed.rs index d4e94d2..6dc1cbb 100644 --- a/kbkdf/src/sealed.rs +++ b/kbkdf/src/sealed.rs @@ -1,10 +1,10 @@ use digest::{ array::typenum::Unsigned, - consts::{U16, U24, U32, U8}, + consts::{U8, U16, U24, U32}, }; mod private { - use digest::consts::{U16, U24, U32, U8}; + use digest::consts::{U8, U16, U24, U32}; pub trait Sealed {} diff --git a/kbkdf/tests/kbkdf/parser.rs b/kbkdf/tests/kbkdf/parser.rs index 29347b0..554f762 100644 --- a/kbkdf/tests/kbkdf/parser.rs +++ b/kbkdf/tests/kbkdf/parser.rs @@ -4,9 +4,9 @@ use kbkdf::{Kbkdf, Params}; use core::{convert::TryInto, ops::Mul}; use digest::{ - array::{typenum::Unsigned, ArraySize}, - crypto_common::KeySizeUser, KeyInit, Mac, + array::{ArraySize, typenum::Unsigned}, + crypto_common::KeySizeUser, }; use crate::*; From 2327bb00097d3bbf22fe8773026082e20afaba6a Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 10:42:43 -0800 Subject: [PATCH 12/17] chore(deps): bump `hex-literal` from `0.4` to `1` --- Cargo.lock | 4 ++-- ansi-x963-kdf/Cargo.toml | 2 +- bake-kdf/Cargo.toml | 2 +- concat-kdf/Cargo.toml | 2 +- hkdf/Cargo.toml | 2 +- kbkdf/Cargo.toml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24fc96c..96b2547 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,9 +140,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[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 = "hkdf" diff --git a/ansi-x963-kdf/Cargo.toml b/ansi-x963-kdf/Cargo.toml index 6e80748..ca15beb 100644 --- a/ansi-x963-kdf/Cargo.toml +++ b/ansi-x963-kdf/Cargo.toml @@ -16,5 +16,5 @@ rust-version = "1.85" digest = "=0.11.0-pre.10" [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" sha2 = { version = "=0.11.0-pre.4", default-features = false } diff --git a/bake-kdf/Cargo.toml b/bake-kdf/Cargo.toml index 5d703bc..ab28574 100644 --- a/bake-kdf/Cargo.toml +++ b/bake-kdf/Cargo.toml @@ -16,7 +16,7 @@ categories = ["cryptography", "no-std"] belt-hash = { version = "0.2.0-pre.4", default-features = false } [dev-dependencies] -hex-literal = "0.4.1" +hex-literal = "1" [package.metadata.docs.rs] all-features = true diff --git a/concat-kdf/Cargo.toml b/concat-kdf/Cargo.toml index 032a33b..261f099 100644 --- a/concat-kdf/Cargo.toml +++ b/concat-kdf/Cargo.toml @@ -16,5 +16,5 @@ rust-version = "1.85" digest = "=0.11.0-pre.10" [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" sha2 = { version = "=0.11.0-pre.4", default-features = false } diff --git a/hkdf/Cargo.toml b/hkdf/Cargo.toml index eab5804..0734522 100644 --- a/hkdf/Cargo.toml +++ b/hkdf/Cargo.toml @@ -17,7 +17,7 @@ hmac = "=0.13.0-pre.4" [dev-dependencies] blobby = "0.3" -hex-literal = "0.4" +hex-literal = "1" sha1 = { version = "=0.11.0-pre.4", default-features = false } sha2 = { version = "=0.11.0-pre.4", default-features = false } diff --git a/kbkdf/Cargo.toml b/kbkdf/Cargo.toml index 3a675cd..98c1ed5 100644 --- a/kbkdf/Cargo.toml +++ b/kbkdf/Cargo.toml @@ -17,7 +17,7 @@ exclude = ["/tests/*"] digest = { version = "0.11.0-pre.10", default-features = false, features = ["mac"] } [dev-dependencies] -hex-literal = "0.4" +hex-literal = "1" hex = "0.4" hmac = { version = "0.13.0-pre.4", default-features = false } sha2 = { version = "0.11.0-pre.4", default-features = false } From 49fe65ef42c4e00334908b3242e845e2b2f2944e Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 13:42:54 -0800 Subject: [PATCH 13/17] kbkdf: disable temporarily minimal-versions --- .github/workflows/kbkdf.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/kbkdf.yml b/.github/workflows/kbkdf.yml index f426fcf..8c609f3 100644 --- a/.github/workflows/kbkdf.yml +++ b/.github/workflows/kbkdf.yml @@ -37,6 +37,7 @@ jobs: - run: cargo build --no-default-features --target ${{ matrix.target }} minimal-versions: + if: false # Disabled because it can't handle git dependencies use to upgrade ecosystem uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: working-directory: ${{ github.workflow }} From 355c0ecbee3c7b45652869f6344f8f4846790abe Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 25 Feb 2025 13:43:18 -0800 Subject: [PATCH 14/17] kbkdf: clippy 1.85 --- kbkdf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kbkdf/src/lib.rs b/kbkdf/src/lib.rs index 02e1623..b5e1a42 100644 --- a/kbkdf/src/lib.rs +++ b/kbkdf/src/lib.rs @@ -273,7 +273,7 @@ where } } -impl<'a, Prf, K, R> Kbkdf for Feedback<'a, Prf, K, R> +impl Kbkdf for Feedback<'_, Prf, K, R> where Prf: Mac + KeyInit, K: KeySizeUser, From 456b9187e1bedf8687cbc58834c87083a92d6db2 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 28 Feb 2025 09:09:11 -0800 Subject: [PATCH 15/17] Rmove SemVer policy --- ansi-x963-kdf/README.md | 5 ----- concat-kdf/README.md | 5 ----- hkdf/README.md | 5 ----- kbkdf/README.md | 5 ----- 4 files changed, 20 deletions(-) diff --git a/ansi-x963-kdf/README.md b/ansi-x963-kdf/README.md index 8f38d07..392789b 100644 --- a/ansi-x963-kdf/README.md +++ b/ansi-x963-kdf/README.md @@ -24,11 +24,6 @@ ansi_x963_kdf::derive_key_into::(b"secret", b"shared-info", &mut key).un assert_eq!(key, hex!("8dbb1d50bcc7fc782abc9db5c64a2826")); ``` -## SemVer Policy - -- All on-by-default features of this library are covered by SemVer -- MSRV is considered exempt from SemVer as noted above - ## License Licensed under either of: diff --git a/concat-kdf/README.md b/concat-kdf/README.md index ad1d6e2..e105aad 100644 --- a/concat-kdf/README.md +++ b/concat-kdf/README.md @@ -25,11 +25,6 @@ concat_kdf::derive_key_into::(b"secret", b"shared-info", &mut key).unwra assert_eq!(key, hex!("960db2c549ab16d71a7b008e005c2bdc")); ``` -## SemVer Policy - -- All on-by-default features of this library are covered by SemVer -- MSRV is considered exempt from SemVer as noted above - ## License Licensed under either of: diff --git a/hkdf/README.md b/hkdf/README.md index d52a51c..cc95cec 100644 --- a/hkdf/README.md +++ b/hkdf/README.md @@ -71,11 +71,6 @@ let expected = hex!(" assert_eq!(okm, expected); ``` -## SemVer Policy - -- All on-by-default features of this library are covered by SemVer -- MSRV is considered exempt from SemVer as noted above - ## License Licensed under either of: diff --git a/kbkdf/README.md b/kbkdf/README.md index c915108..f071a98 100644 --- a/kbkdf/README.md +++ b/kbkdf/README.md @@ -38,11 +38,6 @@ assert_eq!( ); ``` -## SemVer Policy - -- All on-by-default features of this library are covered by SemVer -- MSRV is considered exempt from SemVer as noted above - ## License Licensed under either of: From 863f3768bd8a93b67e3804499fcc27ec7246e357 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 28 Feb 2025 09:10:46 -0800 Subject: [PATCH 16/17] bake-kdf: add licensing info --- bake-kdf/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bake-kdf/README.md b/bake-kdf/README.md index 0d5f625..8149ce3 100644 --- a/bake-kdf/README.md +++ b/bake-kdf/README.md @@ -25,6 +25,21 @@ let key = bake_kdf(&x, &s, c); assert_eq!(key, hex!("bbd7ece0080bee33c776a140f8d807a113a119a4e4d4270f9f2018fbd5e6292e")); ``` +## License + +Licensed under either of: + +* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) +* [MIT license](http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. + [//]: # (badges) From db14dcbfe9f98d3d9c863d437e1c9b1d45f47fd9 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 28 Feb 2025 09:11:14 -0800 Subject: [PATCH 17/17] chore(deps): bump blobby to `0.4` --- Cargo.lock | 4 ++-- hkdf/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96b2547..114041f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,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 = "block-buffer" diff --git a/hkdf/Cargo.toml b/hkdf/Cargo.toml index 0734522..f8d4995 100644 --- a/hkdf/Cargo.toml +++ b/hkdf/Cargo.toml @@ -16,7 +16,7 @@ rust-version = "1.85" hmac = "=0.13.0-pre.4" [dev-dependencies] -blobby = "0.3" +blobby = "=0.4.0-pre.0" hex-literal = "1" sha1 = { version = "=0.11.0-pre.4", default-features = false } sha2 = { version = "=0.11.0-pre.4", default-features = false }