| Crates.io | ansi-x963-kdf |
| lib.rs | ansi-x963-kdf |
| version | 0.1.0-rc.0 |
| created_at | 2024-10-14 11:37:02.479139+00 |
| updated_at | 2025-05-31 02:27:12.790518+00 |
| description | ANSI X9.63 Key Derivation Function |
| homepage | |
| repository | https://github.com/RustCrypto/KDFs |
| max_upload_size | |
| id | 1408200 |
| size | 30,487 |
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.
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"));
Licensed under either of:
at your option.
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.