pub fn generate_keypair<R: CryptoRng + RngCore>(
rng: &mut R,
) -> Result<(Scalar, Point)>
Expand description
Generate a cryptographically secure ECDH keypair
Uses rejection sampling to ensure the private key scalar is uniformly distributed in the range [1, n-1]. The public key is computed as private_key * G where G is the standard base point.
Returns (private_key, public_key) pair suitable for ECDH key agreement.