Skip to content

Commit

Permalink
qol changes
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwicky committed Apr 17, 2024
1 parent c557af4 commit 62a3780
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ use digest::generic_array::{ArrayLength, GenericArray};
use digest::{BlockInput, FixedOutput, Reset, Update};
use hmac::{crypto_mac, Hmac, Mac, NewMac};

pub use x25519_dalek::{
PublicKey, PublicKey as SharedSecret, StaticSecret as PrivateKey,
StaticSecret as EphemeralSecret,
};
//type export and aliasing to keep compatibility
pub use x25519_dalek::PublicKey;
pub type SharedSecret = x25519_dalek::PublicKey;
pub type PrivateKey = x25519_dalek::StaticSecret;
pub type EphemeralSecret = x25519_dalek::StaticSecret;

pub const STREAM_CIPHER_KEY_SIZE: usize = 16;
pub const STREAM_CIPHER_INIT_VECTOR: [u8; 16] = [0u8; 16];
Expand Down
2 changes: 0 additions & 2 deletions src/header/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ impl KeyMaterial {

let mut blinding_factors = vec![initial_secret.clone()];
for (i, node) in route.iter().enumerate() {
// (((pub^a)^b)^...) = pub^{a * b * ...}
// rhs is faster, but leads to security vulnerability, hence lhs is done
let shared_key = blinding_factors
.iter()
.fold(node.pub_key, |acc, blinding_factor| {
Expand Down

0 comments on commit 62a3780

Please sign in to comment.