mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
happy clippy
This commit is contained in:
parent
50dc19b389
commit
fa9e16e938
2 changed files with 4 additions and 4 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),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ impl ReusableSecret {
|
||||||
/// 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 a non-serializeable x25519 [`ReuseableSecret`] key.
|
/// Generate a non-serializeable x25519 [`ReuseableSecret`] key.
|
||||||
|
|
@ -166,7 +166,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