mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-05 20:10:35 +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;
|
||||
|
||||
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);
|
||||
|
||||
c.bench_function("diffie_hellman", move |b| {
|
||||
b.iter_with_setup(
|
||||
|| EphemeralSecret::new(&mut OsRng),
|
||||
|| EphemeralSecret::new(OsRng),
|
||||
|alice_secret| alice_secret.diffie_hellman(&bob_public),
|
||||
)
|
||||
});
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ impl ReusableSecret {
|
|||
/// Perform a Diffie-Hellman key agreement between `self` and
|
||||
/// `their_public` key to produce a [`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.
|
||||
|
|
@ -166,7 +166,7 @@ impl StaticSecret {
|
|||
/// Perform a Diffie-Hellman key agreement between `self` and
|
||||
/// `their_public` key to produce a `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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue