Skip to content

Commit

Permalink
moor doc change
Browse files Browse the repository at this point in the history
  • Loading branch information
jtriley2p committed Jan 30, 2025
1 parent 83cfb21 commit be0fcf2
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/dh/ecdh.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
//! ECDH Key Exchange Algorithm
use crate::{algebra::field::FiniteField, curve::CurveGroup};

// PARAMETERS
// *******************************************
// CURVE the elliptic curve field and equation used
// G a point on the curve that generates a subgroup of large prime order n
// d_A the local secret
// d_B the remote secret (unknown to the local party)
// Q_A the public key d_a × G = Q_A (point on the curve)
// Q_B the public key d_b × G = Q_B (point on the curve)

/// COMPUTE SHARED SECRET
/// *******************************************
/// 1. Compute d_A × Q_B
/// Compute a shared secret from a local secret `d_a` and a foreign elliptic curve point `q_b`.
///
/// ## Arguments
///
/// * `d_a` - The local secret.
/// * `q_b` - The foreign point on the curve.
///
/// ## Returns
///
/// The computed shared secret.
pub fn compute_shared_secret<F: FiniteField, G: CurveGroup<Scalar = F>>(d_a: F, q_b: G) -> G {
q_b * d_a
}
Expand Down

0 comments on commit be0fcf2

Please sign in to comment.