Skip to main content
Version: Next

X448

Algorithm

X448 is Curve448 ECDH (RFC 7748). It is exposed as a legacy/interop path and feature-gated.

Purpose

Curve448 Diffie-Hellman.

Rust API

  • Crate: noxtls-crypto
  • Module path (conceptual): noxtls_crypto::pkc
  • Primary symbols:
    • X448PrivateKey
    • X448PublicKey
    • noxtls_x448_shared_secret
    • noxtls_x448_generate_private_key_auto

Functions and types:

  • noxtls_x448_generate_private_key_auto(drbg) - Parameters: drbg. Behavior: Generate private key scalar. Returns: unspecified output.
  • X448PrivateKey::public_key() - Parameters: no input parameters. Behavior: Derive public key bytes. Returns: unspecified output.
  • noxtls_x448_shared_secret(private, peer_public) - Parameters: private, peer_public. Behavior: Compute shared secret. Returns: unspecified output.

Feature flags and policy

hazardous-legacy-crypto required.

Examples

use noxtls_crypto::{HmacDrbgSha256, noxtls_x448_generate_private_key_auto, noxtls_x448_shared_secret};

let mut drbg = HmacDrbgSha256::new(b"0123456789abcdef", b"nonce", b"x448")?;
let a = noxtls_x448_generate_private_key_auto(&mut drbg)?;
let b = noxtls_x448_generate_private_key_auto(&mut drbg)?;
let a_pub = a.public_key();
let b_pub = b.public_key();
let s1 = noxtls_x448_shared_secret(a, b_pub)?;
let s2 = noxtls_x448_shared_secret(b, a_pub)?;
assert_eq!(s1, s2);
# Ok::<(), noxtls_core::Error>(())

Security and compatibility

Use only under explicit legacy / interop policy.