Skip to content

Commit

Permalink
Update for clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Nov 10, 2023
1 parent 768269e commit bdac321
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/key_exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ where
///
/// That doc specifies that local is public and remote is private, but seems like
/// that shouldn't be necessary.
#[allow(unused)]
pub fn ecmr_add<C>(local: &PublicKey<C>, remote: &PublicKey<C>) -> Result<PublicKey<C>>
where
C: CurveArithmetic,
Expand All @@ -207,7 +206,6 @@ where
// FIXME: subtraction doesn't match up with `jose` for some reason, but appears otherwise correct.
// My guess is that it isn't actually doing subtraction, but I am not sure what it is doing instead...
/// Point subtraction, per ECMR in <https://www.mankier.com/1/jose-jwk-exc>
#[allow(unused)]
pub fn ecmr_sub<C>(local: &PublicKey<C>, remote: &PublicKey<C>) -> Result<PublicKey<C>>
where
C: CurveArithmetic,
Expand Down Expand Up @@ -273,6 +271,7 @@ where
serde_json::from_str(key.to_jwk_string().as_ref()).expect("dependency generated an invalid JWK")
}

#[allow(unused)]
fn jwk_from_priv<C>(key: &SecretKey<C>) -> Jwk
where
C: CurveArithmetic + JwkParameters,
Expand Down
4 changes: 2 additions & 2 deletions src/key_exchange_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn test_roundtrip_full() {
// x = c + e, this is sent to the server
let x_pub = ecmr_add(&c_pub, &e_pub).unwrap();

// y = x & S, server operation, responds with y
// y = x * S, server operation, responds with y
let y_pub = diffie_hellman(&s_priv, &x_pub).unwrap();

// z = s * E
Expand All @@ -190,7 +190,7 @@ fn test_roundtrip_jwk() {

// Pretend to be the server
let server_key_exchange = |x_pub_jwk: &Jwk| -> Result<Jwk> {
let x_pub = jwk_to_pub(&x_pub_jwk).unwrap();
let x_pub = jwk_to_pub(x_pub_jwk).unwrap();
let y_pub = diffie_hellman(&s_priv, &x_pub).unwrap();
Ok(jwk_from_pub(&y_pub))
};
Expand Down

0 comments on commit bdac321

Please sign in to comment.