Просмотр исходного кода

research/x3dh: Formatting fixes

parazyd 3 лет назад
Родитель
Сommit
ce26ad15a7
2 измененных файлов с 2 добавлено и 4 удалено
  1. 0 2
      script/research/x3dh/src/main.rs
  2. 2 2
      script/research/x3dh/src/xeddsa.rs

+ 0 - 2
script/research/x3dh/src/main.rs

@@ -450,7 +450,6 @@ fn main() {
     // at some interval (e.g. once a week/month). The new signed prekey
     // and prekey signature will replace the previous values.
 
-    
     // Bob's signed prekey `SPK_B`
     let bob_spk_secret = X25519SecretKey::new(OsRng);
     let bob_public_spk = X25519PublicKey::from(&bob_spk_secret);
@@ -458,7 +457,6 @@ fn main() {
     // Bob's prekey signature `Sig(IK_b, Encode(SPK_B))`
     let nonce = [0_u8; 64];
     let bob_spk_signature = bob_ik_secret.xeddsa_sign(&bob_public_spk.to_bytes(), &nonce);
-   
 
     // A set of Bob's one-time prekeys `(OPK_B1, OPK_B2, OPK_B3, ...)`
     let mut bob_opk_secrets =

+ 2 - 2
script/research/x3dh/src/xeddsa.rs

@@ -22,8 +22,8 @@ use curve25519_dalek::{
     constants::ED25519_BASEPOINT_POINT, montgomery::MontgomeryPoint, scalar::Scalar,
 };
 use digest::Digest;
-use sha2::Sha512;
 use ed25519_dalek::{Signature, VerifyingKey as Ed25519PublicKey};
+use sha2::Sha512;
 use x25519_dalek::{PublicKey as X25519PublicKey, StaticSecret as X25519SecretKey};
 
 pub trait XeddsaSigner {
@@ -128,7 +128,7 @@ mod tests {
     fn xeddsa_test() {
         let nonce = [0u8; 64];
         let msg = [0u8; 200];
- 
+
         let xsecret_key = X25519SecretKey::new(&mut OsRng);
         let xpublic_key = X25519PublicKey::from(&xsecret_key);