Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jtriley2p committed Jan 30, 2025
1 parent 8d57253 commit 5772bed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/dh/ecdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ use crate::{algebra::field::FiniteField, curve::CurveGroup};
/// COMPUTE SHARED SECRET
/// *******************************************
/// 1. Compute d_A × Q_B
pub fn compute_shared_secret<F: FiniteField, G: CurveGroup<Scalar = F>>(
d_a: F,
q_b: G,
) -> G {
pub fn compute_shared_secret<F: FiniteField, G: CurveGroup<Scalar = F>>(d_a: F, q_b: G) -> G {
q_b * d_a
}

Expand Down
8 changes: 2 additions & 6 deletions src/dh/tp_ecdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ pub fn compute_shared_secret(
mod tests {
use super::*;
use crate::{
algebra::{
field::prime::PlutoScalarField,
group::FiniteCyclicGroup,
Finite,
},
algebra::{field::prime::PlutoScalarField, group::FiniteCyclicGroup, Finite},
curve::{pluto_curve::PlutoBaseCurve, AffinePoint},
};

Expand Down Expand Up @@ -113,7 +109,7 @@ mod tests {
println!("shared_secret_a = {shared_secret_a:?}");
println!("shared_secret_b = {shared_secret_b:?}");
println!("shared_secret_c = {shared_secret_c:?}");

// -- TMP ----------------------------------------

assert_eq!(shared_secret_a, shared_secret_b);
Expand Down

0 comments on commit 5772bed

Please sign in to comment.