mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
fix clippy warnings
This commit is contained in:
parent
50dbb9eb4d
commit
7374fd3d2f
2 changed files with 3 additions and 3 deletions
|
|
@ -25,12 +25,12 @@ use x25519_dalek::EphemeralSecret;
|
||||||
use x25519_dalek::PublicKey;
|
use x25519_dalek::PublicKey;
|
||||||
|
|
||||||
fn bench_diffie_hellman(c: &mut Criterion) {
|
fn bench_diffie_hellman(c: &mut Criterion) {
|
||||||
let bob_secret = EphemeralSecret::new(&mut OsRng);
|
let bob_secret = EphemeralSecret::new(OsRng);
|
||||||
let bob_public = PublicKey::from(&bob_secret);
|
let bob_public = PublicKey::from(&bob_secret);
|
||||||
|
|
||||||
c.bench_function("diffie_hellman", move |b| {
|
c.bench_function("diffie_hellman", move |b| {
|
||||||
b.iter_with_setup(
|
b.iter_with_setup(
|
||||||
|| EphemeralSecret::new(&mut OsRng),
|
|| EphemeralSecret::new(OsRng),
|
||||||
|alice_secret| alice_secret.diffie_hellman(&bob_public),
|
|alice_secret| alice_secret.diffie_hellman(&bob_public),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ impl StaticSecret {
|
||||||
/// Perform a Diffie-Hellman key agreement between `self` and
|
/// Perform a Diffie-Hellman key agreement between `self` and
|
||||||
/// `their_public` key to produce a `SharedSecret`.
|
/// `their_public` key to produce a `SharedSecret`.
|
||||||
pub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret {
|
pub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret {
|
||||||
SharedSecret(&self.0 * their_public.0)
|
SharedSecret(self.0 * their_public.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generate an x25519 key.
|
/// Generate an x25519 key.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue