#kdf #sec1

no-std ansi-x963-kdf

ANSI X9.63 Key Derivation Function

4 releases

Uses new Rust 2024

0.1.0-rc.1 Nov 5, 2025
0.1.0-rc.0 May 31, 2025
0.0.1 Feb 13, 2025
0.0.0 Oct 14, 2024

#2991 in Cryptography

Download history 216/week @ 2025-08-18 76/week @ 2025-08-25 155/week @ 2025-09-01 114/week @ 2025-09-08 201/week @ 2025-09-15 70/week @ 2025-09-22 146/week @ 2025-09-29 122/week @ 2025-10-06 97/week @ 2025-10-13 50/week @ 2025-10-20 141/week @ 2025-10-27 266/week @ 2025-11-03 129/week @ 2025-11-10 147/week @ 2025-11-17 28/week @ 2025-11-24 69/week @ 2025-12-01

376 downloads per month

MIT/Apache

13KB
58 lines

RustCrypto: ANSI X9.63 Key Derivation Function

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Pure Rust implementation of the ANSI X9.63 Key Derivation Function (ANSI-X9.63-KDF) generic over hash function. This function is described in the section 3.6.1 of SEC 1: Elliptic Curve Cryptography.

Usage

The most common way to use ANSI-X9.63-KDF is as follows: you generate a shared secret with other party (e.g. via Diffie-Hellman algorithm) and use key derivation function to derive a shared key.

use hex_literal::hex;
use sha2::Sha256;

let mut key = [0u8; 16];
ansi_x963_kdf::derive_key_into::<Sha256>(b"secret", b"shared-info", &mut key).unwrap();
assert_eq!(key, hex!("8dbb1d50bcc7fc782abc9db5c64a2826"));

License

Licensed under either of:

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.

Dependencies

~655KB
~17K SLoC