Skip to content

Commit d0f5a94

Browse files
committed
Rename concat-kdf to one-step-kdf
The name of the KDF was changed in the latest revision of NIST SP 800-56 https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr2.pdf
1 parent 8da1f4a commit d0f5a94

File tree

10 files changed

+42
-40
lines changed

10 files changed

+42
-40
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: concat-kdf
1+
name: one-step-kdf
22

33
on:
44
pull_request:
55
paths:
6-
- ".github/workflows/concat-kdf.yml"
7-
- "concat-kdf/**"
6+
- ".github/workflows/one-step-kdf.yml"
7+
- "one-step-kdf/**"
88
- "Cargo.*"
99
push:
1010
branches: master
1111

1212
defaults:
1313
run:
14-
working-directory: concat-kdf
14+
working-directory: one-step-kdf
1515

1616
env:
1717
CARGO_INCREMENTAL: 0

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[workspace]
22
resolver = "2"
33
members = [
4+
"ansi-x963-kdf",
45
"bake-kdf",
56
"hkdf",
6-
"concat-kdf",
7-
"ansi-x963-kdf",
87
"kbkdf",
8+
"one-step-kdf"
99
]
1010

1111
[profile.dev]
File renamed without changes.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
2-
name = "concat-kdf"
3-
version = "0.2.0-pre"
4-
description = "Concatenation Key Derivation Function (Concat KDF)"
2+
name = "one-step-kdf"
3+
version = "0.1.0-pre"
4+
description = "One-Step Key Derivation Function as defined in NIST SP 800-56C R2"
55
authors = ["RustCrypto Developers"]
66
license = "MIT OR Apache-2.0"
77
readme = "README.md"
88
edition = "2024"
9-
documentation = "https://docs.rs/concat-kdf"
9+
documentation = "https://docs.rs/one-step-kdf"
1010
repository = "https://github.com/RustCrypto/KDFs"
11-
keywords = ["crypto", "concat-kdf", "KDF", "NIST"]
11+
keywords = ["crypto", "one-step-kdf", "KDF", "NIST"]
1212
categories = ["cryptography", "no-std"]
1313
rust-version = "1.85"
1414

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
# RustCrypto: Concat KDF
1+
# RustCrypto: One-Step KDF
22

33
[![crate][crate-image]][crate-link]
44
[![Docs][docs-image]][docs-link]
5+
[![Build Status][build-image]][build-link]
56
![Apache2/MIT licensed][license-image]
67
![Rust Version][rustc-image]
78
[![Project Chat][chat-image]][chat-link]
8-
[![Build Status][build-image]][build-link]
99

10-
Pure Rust implementation of the Concatenation Key Derivation Function (Concat KDF) generic over hash function.
11-
This function is described in the section 5.8.1 of [NIST SP 800-56A, Recommendation for Pair-Wise Key Establishment
12-
Schemes Using Discrete Logarithm Cryptography](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-56ar.pdf).
10+
Pure Rust implementation of the One-Step Key Derivation Function (formerly known as Concat KDF)
11+
implemented generically over the underlying hash function.
12+
13+
This KDF is described in the section 4 of
14+
[NIST SP 800-56C: Recommendation for Key-Derivation Methods in Key-Establishment Schemes](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr2.pdf).
1315

1416
# Usage
1517

16-
The most common way to use Concat KDF is as follows: you generate a shared secret with other party
18+
The most common way to use One-Step KDF is as follows: you generate a shared secret with other party
1719
(e.g. via Diffie-Hellman algorithm) and use key derivation function to derive a shared key.
1820

1921
```rust
2022
use hex_literal::hex;
2123
use sha2::Sha256;
2224

2325
let mut key = [0u8; 16];
24-
concat_kdf::derive_key_into::<Sha256>(b"secret", b"shared-info", &mut key).unwrap();
26+
one_step_kdf::derive_key_into::<Sha256>(b"secret", b"shared-info", &mut key).unwrap();
2527
assert_eq!(key, hex!("960db2c549ab16d71a7b008e005c2bdc"));
2628
```
2729

@@ -40,13 +42,13 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
4042
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
4143
dual licensed as above, without any additional terms or conditions.
4244

43-
[crate-image]: https://img.shields.io/crates/v/concat-kdf.svg
44-
[crate-link]: https://crates.io/crates/concat-kdf
45-
[docs-image]: https://docs.rs/concat-kdf/badge.svg
46-
[docs-link]: https://docs.rs/concat-kdf/
45+
[crate-image]: https://img.shields.io/crates/v/one-step-kdf.svg
46+
[crate-link]: https://crates.io/crates/one-step-kdf
47+
[docs-image]: https://docs.rs/one-step-kdf/badge.svg
48+
[docs-link]: https://docs.rs/one-step-kdf/
49+
[build-image]: https://github.com/RustCrypto/KDFs/actions/workflows/one-step-kdf.yml/badge.svg
50+
[build-link]: https://github.com/RustCrypto/KDFs/actions/workflows/one-step-kdf.yml
4751
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
4852
[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg
4953
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
5054
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260043-KDFs
51-
[build-image]: https://github.com/RustCrypto/KDFs/workflows/concat-kdf/badge.svg?branch=master&event=push
52-
[build-link]: https://github.com/RustCrypto/KDFs/actions?query=workflow:concat-kdf
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use digest::{Digest, FixedOutputReset, Update, array::typenum::Unsigned};
1919
/// use sha2::Sha256;
2020
///
2121
/// let mut key = [0u8; 16];
22-
/// concat_kdf::derive_key_into::<Sha256>(b"secret", b"shared-info", &mut key).unwrap();
22+
/// one_step_kdf::derive_key_into::<Sha256>(b"secret", b"shared-info", &mut key).unwrap();
2323
/// assert_eq!(key, hex!("960db2c549ab16d71a7b008e005c2bdc"));
2424
/// ```
2525
pub fn derive_key_into<D>(secret: &[u8], other_info: &[u8], key: &mut [u8]) -> Result<(), Error>
@@ -53,7 +53,7 @@ where
5353
Ok(())
5454
}
5555

56-
/// Concat KDF errors.
56+
/// One-Step KDF errors.
5757
#[derive(Clone, Copy, Debug, PartialEq)]
5858
pub enum Error {
5959
/// The length of the secret is zero.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ where
1616
let mut buf = [0u8; 256];
1717
for key_length in 1..f.expected_key.len() {
1818
let key = &mut buf[..key_length];
19-
concat_kdf::derive_key_into::<D>(f.secret, f.other_info, key).unwrap();
19+
one_step_kdf::derive_key_into::<D>(f.secret, f.other_info, key).unwrap();
2020
assert_eq!(&f.expected_key[..key_length], key);
2121
}
2222
}
@@ -175,15 +175,15 @@ fn test_input_output_sha512() {
175175
#[test]
176176
fn test_no_secret() {
177177
assert_eq!(
178-
concat_kdf::derive_key_into::<Sha512>(&[], &[], &mut [0u8; 42]),
179-
Err(concat_kdf::Error::NoSecret)
178+
one_step_kdf::derive_key_into::<Sha512>(&[], &[], &mut [0u8; 42]),
179+
Err(one_step_kdf::Error::NoSecret)
180180
);
181181
}
182182

183183
#[test]
184184
fn test_no_output() {
185185
assert_eq!(
186-
concat_kdf::derive_key_into::<Sha512>(&[0u8; 42], &[], &mut [0u8; 0]),
187-
Err(concat_kdf::Error::NoOutput)
186+
one_step_kdf::derive_key_into::<Sha512>(&[0u8; 42], &[], &mut [0u8; 0]),
187+
Err(one_step_kdf::Error::NoOutput)
188188
);
189189
}

0 commit comments

Comments
 (0)