Browse Source

rustfmt auto-formatting

Ian Goldberg 1 year ago
parent
commit
3bfa021aa1
2 changed files with 164 additions and 111 deletions
  1. 155 102
      src/ggm.rs
  2. 9 9
      tests/ggm.rs

+ 155 - 102
src/ggm.rs

@@ -13,8 +13,8 @@
 use sha2::Sha512;
 
 use curve25519_dalek::constants as dalek_constants;
-use curve25519_dalek::ristretto::RistrettoPoint;
 use curve25519_dalek::ristretto::RistrettoBasepointTable;
+use curve25519_dalek::ristretto::RistrettoPoint;
 use curve25519_dalek::scalar::Scalar;
 
 use lazy_static::lazy_static;
@@ -22,15 +22,13 @@ use lazy_static::lazy_static;
 lazy_static! {
     pub static ref CMZ_A: RistrettoPoint =
         RistrettoPoint::hash_from_bytes::<Sha512>(b"CMZ Generator A");
-    pub static ref CMZ_B: RistrettoPoint =
-        dalek_constants::RISTRETTO_BASEPOINT_POINT;
-    pub static ref CMZ_A_TABLE: RistrettoBasepointTable =
-        RistrettoBasepointTable::create(&CMZ_A);
+    pub static ref CMZ_B: RistrettoPoint = dalek_constants::RISTRETTO_BASEPOINT_POINT;
+    pub static ref CMZ_A_TABLE: RistrettoBasepointTable = RistrettoBasepointTable::create(&CMZ_A);
     pub static ref CMZ_B_TABLE: RistrettoBasepointTable =
         dalek_constants::RISTRETTO_BASEPOINT_TABLE;
 }
 
-#[derive(Clone,Debug)]
+#[derive(Clone, Debug)]
 pub struct IssuerPrivKey {
     x0tilde: Scalar,
     x: Vec<Scalar>,
@@ -42,16 +40,16 @@ impl IssuerPrivKey {
     pub fn new(n: u16) -> IssuerPrivKey {
         let mut rng: rand::rngs::ThreadRng = rand::thread_rng();
         let x0tilde: Scalar = Scalar::random(&mut rng);
-        let mut x: Vec<Scalar> = Vec::with_capacity((n+1) as usize);
+        let mut x: Vec<Scalar> = Vec::with_capacity((n + 1) as usize);
 
         // Set x to a vector of n+1 random Scalars
-        x.resize_with((n+1) as usize, || { Scalar::random(&mut rng) });
+        x.resize_with((n + 1) as usize, || Scalar::random(&mut rng));
 
         IssuerPrivKey { x0tilde, x }
     }
 }
 
-#[derive(Clone,Debug)]
+#[derive(Clone, Debug)]
 pub struct IssuerPubKey {
     X: Vec<RistrettoPoint>,
 }
@@ -59,8 +57,8 @@ pub struct IssuerPubKey {
 impl IssuerPubKey {
     // Create an IssuerPubKey from the corresponding IssuerPrivKey
     pub fn new(privkey: &IssuerPrivKey) -> IssuerPubKey {
-        let Atable : &RistrettoBasepointTable = &CMZ_A_TABLE;
-        let Btable : &RistrettoBasepointTable = &CMZ_B_TABLE;
+        let Atable: &RistrettoBasepointTable = &CMZ_A_TABLE;
+        let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE;
         let n_plus_one: usize = privkey.x.len();
         let mut X: Vec<RistrettoPoint> = Vec::with_capacity(n_plus_one);
 
@@ -113,8 +111,8 @@ pub struct Credential {
 // do a ZKP at all.  The more general blinded issuing case is the next
 // submodule after this one.
 pub mod issue_nonblind_5 {
-    use curve25519_dalek::ristretto::RistrettoPoint;
     use curve25519_dalek::ristretto::RistrettoBasepointTable;
+    use curve25519_dalek::ristretto::RistrettoPoint;
     use curve25519_dalek::scalar::Scalar;
     use curve25519_dalek::traits::IsIdentity;
 
@@ -122,7 +120,7 @@ pub mod issue_nonblind_5 {
     use zkp::ProofError;
     use zkp::Transcript;
 
-    use super::{CMZ_A,CMZ_B,CMZ_B_TABLE,Issuer,IssuerPubKey,Credential};
+    use super::{Credential, Issuer, IssuerPubKey, CMZ_A, CMZ_B, CMZ_B_TABLE};
 
     #[derive(Debug)]
     pub struct CredentialRequest {
@@ -163,9 +161,13 @@ pub mod issue_nonblind_5 {
         Q = (x0*P + x1*P1 + x2*P2 + x3*P3 + x4*P4 + x5*P5)
     }
 
-    pub fn request(m1: &Scalar, m2: &Scalar, m3: &Scalar,
-            m4: &Scalar, m5: &Scalar) -> (CredentialRequest,
-            CredentialRequestState) {
+    pub fn request(
+        m1: &Scalar,
+        m2: &Scalar,
+        m3: &Scalar,
+        m4: &Scalar,
+        m5: &Scalar,
+    ) -> (CredentialRequest, CredentialRequestState) {
         // For nonblind requests, just send the attributes in the clear
         (
             CredentialRequest {
@@ -173,26 +175,25 @@ pub mod issue_nonblind_5 {
                 m2: *m2,
                 m3: *m3,
                 m4: *m4,
-                m5: *m5
+                m5: *m5,
             },
             CredentialRequestState {
                 m1: *m1,
                 m2: *m2,
                 m3: *m3,
                 m4: *m4,
-                m5: *m5
-            }
+                m5: *m5,
+            },
         )
     }
 
     impl Issuer {
         // Issue a credential with (for example) 5 given attributes.  In
         // this (nonblinded) version, the issuer sees all of the attributes.
-        pub fn issue_nonblind_5(&self, req: CredentialRequest)
-                -> CredentialResponse {
-            let A : &RistrettoPoint = &CMZ_A;
-            let B : &RistrettoPoint = &CMZ_B;
-            let Btable : &RistrettoBasepointTable = &CMZ_B_TABLE;
+        pub fn issue_nonblind_5(&self, req: CredentialRequest) -> CredentialResponse {
+            let A: &RistrettoPoint = &CMZ_A;
+            let B: &RistrettoPoint = &CMZ_B;
+            let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE;
 
             let mut rng: rand::rngs::ThreadRng = rand::thread_rng();
             let b: Scalar = Scalar::random(&mut rng);
@@ -200,12 +201,13 @@ pub mod issue_nonblind_5 {
             // There is a typo in the Hyphae paper: in Section 4.1, Q should
             // also have an x0*P term (also in Q').  (You can see that term
             // in Section 4.2.)
-            let Q: RistrettoPoint = (self.privkey.x[0] + (
-                self.privkey.x[1] * req.m1 +
-                self.privkey.x[2] * req.m2 +
-                self.privkey.x[3] * req.m3 +
-                self.privkey.x[4] * req.m4 +
-                self.privkey.x[5] * req.m5)) * P;
+            let Q: RistrettoPoint = (self.privkey.x[0]
+                + (self.privkey.x[1] * req.m1
+                    + self.privkey.x[2] * req.m2
+                    + self.privkey.x[3] * req.m3
+                    + self.privkey.x[4] * req.m4
+                    + self.privkey.x[5] * req.m5))
+                * P;
 
             let mut transcript = Transcript::new(b"Nonblind 5 issuing proof");
             let piNonblindIssue: CompactProof = issue::prove_compact(
@@ -232,18 +234,26 @@ pub mod issue_nonblind_5 {
                     x3: &self.privkey.x[3],
                     x4: &self.privkey.x[4],
                     x5: &self.privkey.x[5],
-                    x0tilde: &self.privkey.x0tilde
-                }).0;
-
-            CredentialResponse { P, Q, piNonblindIssue }
+                    x0tilde: &self.privkey.x0tilde,
+                },
+            )
+            .0;
+
+            CredentialResponse {
+                P,
+                Q,
+                piNonblindIssue,
+            }
         }
     }
 
-    pub fn verify(state: CredentialRequestState,
-            resp: CredentialResponse, pubkey: &IssuerPubKey)
-            -> Result<Credential, ProofError> {
-        let A : &RistrettoPoint = &CMZ_A;
-        let B : &RistrettoPoint = &CMZ_B;
+    pub fn verify(
+        state: CredentialRequestState,
+        resp: CredentialResponse,
+        pubkey: &IssuerPubKey,
+    ) -> Result<Credential, ProofError> {
+        let A: &RistrettoPoint = &CMZ_A;
+        let B: &RistrettoPoint = &CMZ_B;
 
         if resp.P.is_identity() {
             return Err(ProofError::VerificationFailure);
@@ -268,13 +278,19 @@ pub mod issue_nonblind_5 {
                 P3: &(state.m3 * resp.P).compress(),
                 P4: &(state.m4 * resp.P).compress(),
                 P5: &(state.m5 * resp.P).compress(),
-            }
+            },
         )?;
         Ok(Credential {
             P: resp.P,
             Q: resp.Q,
-            m: vec![Scalar::zero(), state.m1, state.m2,
-                    state.m3, state.m4, state.m5],
+            m: vec![
+                Scalar::zero(),
+                state.m1,
+                state.m2,
+                state.m3,
+                state.m4,
+                state.m5,
+            ],
         })
     }
 }
@@ -290,8 +306,8 @@ pub mod issue_nonblind_5 {
 // generally knows the set of statements one will require at compile,
 // and not at run, time.
 pub mod issue_blind124_5 {
-    use curve25519_dalek::ristretto::RistrettoPoint;
     use curve25519_dalek::ristretto::RistrettoBasepointTable;
+    use curve25519_dalek::ristretto::RistrettoPoint;
     use curve25519_dalek::scalar::Scalar;
     use curve25519_dalek::traits::IsIdentity;
 
@@ -299,8 +315,8 @@ pub mod issue_blind124_5 {
     use zkp::ProofError;
     use zkp::Transcript;
 
-    use super::{CMZ_A,CMZ_B,CMZ_A_TABLE,CMZ_B_TABLE};
-    use super::{Issuer,IssuerPubKey,Credential};
+    use super::{Credential, Issuer, IssuerPubKey};
+    use super::{CMZ_A, CMZ_A_TABLE, CMZ_B, CMZ_B_TABLE};
 
     // Example of a 5-attribute credential where the issuer sees attributes
     // 3 and 5, but attributes 1, 2, and 4 are blinded.
@@ -383,11 +399,15 @@ pub mod issue_blind124_5 {
                 x0*P + x3*P3 + x5*P5)
     }
 
-    pub fn request(m1: &Scalar, m2: &Scalar, m3: &Scalar,
-            m4: &Scalar, m5: &Scalar) -> (CredentialRequest,
-            CredentialRequestState) {
-        let B : &RistrettoPoint = &CMZ_B;
-        let Btable : &RistrettoBasepointTable = &CMZ_B_TABLE;
+    pub fn request(
+        m1: &Scalar,
+        m2: &Scalar,
+        m3: &Scalar,
+        m4: &Scalar,
+        m5: &Scalar,
+    ) -> (CredentialRequest, CredentialRequestState) {
+        let B: &RistrettoPoint = &CMZ_B;
+        let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE;
 
         // Pick an ElGamal keypair
         let mut rng: rand::rngs::ThreadRng = rand::thread_rng();
@@ -422,33 +442,45 @@ pub mod issue_blind124_5 {
                 m1: &m1,
                 m2: &m2,
                 m4: &m4,
-            }).0;
+            },
+        )
+        .0;
         (
             CredentialRequest {
-                D, Encm1B, Encm2B, Encm4B, piUserBlinding,
+                D,
+                Encm1B,
+                Encm2B,
+                Encm4B,
+                piUserBlinding,
                 m3: *m3,
                 m5: *m5,
             },
             CredentialRequestState {
-                d, D, Encm1B, Encm2B, Encm4B,
+                d,
+                D,
+                Encm1B,
+                Encm2B,
+                Encm4B,
                 m1: *m1,
                 m2: *m2,
                 m3: *m3,
                 m4: *m4,
                 m5: *m5,
-            }
+            },
         )
     }
 
     impl Issuer {
         // Issue a credential with 5 attributes, of which attributes 1, 2,
         // and 4 are blinded from the issuer, and 3 and 5 are visible.
-        pub fn issue_blind124_5(&self, req: CredentialRequest)
-                -> Result<CredentialResponse, ProofError> {
-            let A : &RistrettoPoint = &CMZ_A;
-            let B : &RistrettoPoint = &CMZ_B;
-            let Atable : &RistrettoBasepointTable = &CMZ_A_TABLE;
-            let Btable : &RistrettoBasepointTable = &CMZ_B_TABLE;
+        pub fn issue_blind124_5(
+            &self,
+            req: CredentialRequest,
+        ) -> Result<CredentialResponse, ProofError> {
+            let A: &RistrettoPoint = &CMZ_A;
+            let B: &RistrettoPoint = &CMZ_B;
+            let Atable: &RistrettoBasepointTable = &CMZ_A_TABLE;
+            let Btable: &RistrettoBasepointTable = &CMZ_B_TABLE;
 
             // First check the proof in the request
             let mut transcript = Transcript::new(b"Blind124 5 userblind proof");
@@ -464,35 +496,36 @@ pub mod issue_blind124_5 {
                     Encm4B0: &req.Encm4B.0.compress(),
                     Encm4B1: &req.Encm4B.1.compress(),
                     D: &req.D.compress(),
-                }
+                },
             )?;
 
             // Compute the MAC on the visible attributes
             let mut rng: rand::rngs::ThreadRng = rand::thread_rng();
             let b: Scalar = Scalar::random(&mut rng);
             let P: RistrettoPoint = &b * Btable;
-            let QHc: RistrettoPoint = (self.privkey.x[0] + (
-                self.privkey.x[3] * req.m3 +
-                self.privkey.x[5] * req.m5)) * P;
+            let QHc: RistrettoPoint =
+                (self.privkey.x[0] + (self.privkey.x[3] * req.m3 + self.privkey.x[5] * req.m5)) * P;
 
             // El Gamal encrypt it to the public key req.D
             let s: Scalar = Scalar::random(&mut rng);
-            let EncQHc = (&s*Btable, QHc + s*req.D);
+            let EncQHc = (&s * Btable, QHc + s * req.D);
 
             // Homomorphically compute the part of the MAC corresponding to
             // the blinded attributes
             let t1 = self.privkey.x[1] * b;
             let T1 = &t1 * Atable;
-            let EncQ1 = ( t1 * req.Encm1B.0, t1 * req.Encm1B.1 );
+            let EncQ1 = (t1 * req.Encm1B.0, t1 * req.Encm1B.1);
             let t2 = self.privkey.x[2] * b;
             let T2 = &t2 * Atable;
-            let EncQ2 = ( t2 * req.Encm2B.0, t2 * req.Encm2B.1 );
+            let EncQ2 = (t2 * req.Encm2B.0, t2 * req.Encm2B.1);
             let t4 = self.privkey.x[4] * b;
             let T4 = &t4 * Atable;
-            let EncQ4 = ( t4 * req.Encm4B.0, t4 * req.Encm4B.1 );
+            let EncQ4 = (t4 * req.Encm4B.0, t4 * req.Encm4B.1);
 
-            let EncQ = ( EncQHc.0 + EncQ1.0 + EncQ2.0 + EncQ4.0,
-                         EncQHc.1 + EncQ1.1 + EncQ2.1 + EncQ4.1 );
+            let EncQ = (
+                EncQHc.0 + EncQ1.0 + EncQ2.0 + EncQ4.0,
+                EncQHc.1 + EncQ1.1 + EncQ2.1 + EncQ4.1,
+            );
 
             let mut transcript = Transcript::new(b"Blind124 5 issuing proof");
             let piBlindIssue: CompactProof = blindissue::prove_compact(
@@ -532,20 +565,29 @@ pub mod issue_blind124_5 {
                     b: &b,
                     t1: &t1,
                     t2: &t2,
-                    t4: &t4
-                }).0;
+                    t4: &t4,
+                },
+            )
+            .0;
 
             Ok(CredentialResponse {
-                P, EncQ, T1, T2, T4, piBlindIssue
+                P,
+                EncQ,
+                T1,
+                T2,
+                T4,
+                piBlindIssue,
             })
         }
     }
 
-    pub fn verify(state: CredentialRequestState,
-            resp: CredentialResponse, pubkey: &IssuerPubKey)
-            -> Result<Credential, ProofError> {
-        let A : &RistrettoPoint = &CMZ_A;
-        let B : &RistrettoPoint = &CMZ_B;
+    pub fn verify(
+        state: CredentialRequestState,
+        resp: CredentialResponse,
+        pubkey: &IssuerPubKey,
+    ) -> Result<Credential, ProofError> {
+        let A: &RistrettoPoint = &CMZ_A;
+        let B: &RistrettoPoint = &CMZ_B;
 
         if resp.P.is_identity() {
             return Err(ProofError::VerificationFailure);
@@ -579,7 +621,7 @@ pub mod issue_blind124_5 {
                 Encm2B1: &state.Encm2B.1.compress(),
                 Encm4B0: &state.Encm4B.0.compress(),
                 Encm4B1: &state.Encm4B.1.compress(),
-            }
+            },
         )?;
 
         // Decrypt EncQ
@@ -588,8 +630,14 @@ pub mod issue_blind124_5 {
         Ok(Credential {
             P: resp.P,
             Q,
-            m: vec![Scalar::zero(), state.m1, state.m2,
-                    state.m3, state.m4, state.m5],
+            m: vec![
+                Scalar::zero(),
+                state.m1,
+                state.m2,
+                state.m3,
+                state.m4,
+                state.m5,
+            ],
         })
     }
 }
@@ -598,8 +646,8 @@ pub mod issue_blind124_5 {
 // attributes 3, 4, and 5, and displaying attributes 1 and 2.  As above,
 // this could possibly be generated by a Rust macro in the future.
 pub mod show_blind345_5 {
-    use curve25519_dalek::ristretto::RistrettoPoint;
     use curve25519_dalek::ristretto::RistrettoBasepointTable;
+    use curve25519_dalek::ristretto::RistrettoPoint;
     use curve25519_dalek::scalar::Scalar;
     use curve25519_dalek::traits::IsIdentity;
 
@@ -607,7 +655,7 @@ pub mod show_blind345_5 {
     use zkp::ProofError;
     use zkp::Transcript;
 
-    use super::{CMZ_A,CMZ_A_TABLE,Issuer,IssuerPubKey,Credential};
+    use super::{Credential, Issuer, IssuerPubKey, CMZ_A, CMZ_A_TABLE};
 
     // A typo in the Hyphae paper (Section 4.4): P must also be sent to
     // the issuer in the credential presentation message.
@@ -632,7 +680,7 @@ pub mod show_blind345_5 {
     }
 
     // If you want to prove additional statements about the blinded
-    // attributes when showing them, this is the place to add those 
+    // attributes when showing them, this is the place to add those
     // statements (and also the code that creates and verifies this
     // proof).
     define_proof! {
@@ -647,10 +695,9 @@ pub mod show_blind345_5 {
         V = (z3*X3 + z4*X4 + z5*X5 + negzQ*A)
     }
 
-    pub fn show(cred: &Credential, pubkey: &IssuerPubKey)
-            -> ShowMessage {
-        let A : &RistrettoPoint = &CMZ_A;
-        let Atable : &RistrettoBasepointTable = &CMZ_A_TABLE;
+    pub fn show(cred: &Credential, pubkey: &IssuerPubKey) -> ShowMessage {
+        let A: &RistrettoPoint = &CMZ_A;
+        let Atable: &RistrettoBasepointTable = &CMZ_A_TABLE;
 
         // Reblind P and Q
         let mut rng: rand::rngs::ThreadRng = rand::thread_rng();
@@ -674,9 +721,8 @@ pub mod show_blind345_5 {
         let CQ: RistrettoPoint = Q - &negzQ * Atable;
 
         // Compute the "error factor"
-        let V: RistrettoPoint = z3 * pubkey.X[3]
-                + z4 * pubkey.X[4] + z5 * pubkey.X[5]
-                + &negzQ * Atable;
+        let V: RistrettoPoint =
+            z3 * pubkey.X[3] + z4 * pubkey.X[4] + z5 * pubkey.X[5] + &negzQ * Atable;
 
         // Create the ZKP
         let mut transcript = Transcript::new(b"Blind345 5 showing proof");
@@ -698,14 +744,20 @@ pub mod show_blind345_5 {
                 z3: &z3,
                 z4: &z4,
                 z5: &z5,
-                negzQ: &negzQ
-            }).0;
+                negzQ: &negzQ,
+            },
+        )
+        .0;
 
         ShowMessage {
             P,
             m1: cred.m[1],
             m2: cred.m[2],
-            Cm3, Cm4, Cm5, CQ, piCredShow
+            Cm3,
+            Cm4,
+            Cm5,
+            CQ,
+            piCredShow,
         }
     }
 
@@ -716,9 +768,11 @@ pub mod show_blind345_5 {
         // will end up with verified Pedersen commitments Cm3, Cm4, Cm5
         // to the blinded attributes, so that additional things can be
         // proved about those attributes in zero knowledge if desired.
-        pub fn verify_blind345_5(&self, showmsg: ShowMessage)
-                -> Result<VerifiedCredential, ProofError> {
-            let A : &RistrettoPoint = &CMZ_A;
+        pub fn verify_blind345_5(
+            &self,
+            showmsg: ShowMessage,
+        ) -> Result<VerifiedCredential, ProofError> {
+            let A: &RistrettoPoint = &CMZ_A;
 
             if showmsg.P.is_identity() {
                 return Err(ProofError::VerificationFailure);
@@ -727,10 +781,9 @@ pub mod show_blind345_5 {
             // Recompute the "error factor" using knowledge of our own
             // (the issuer's) private key instead of knowledge of the
             // hidden attributes
-            let Vprime: RistrettoPoint =
-                (self.privkey.x[0]
-                   + (self.privkey.x[1] * showmsg.m1
-                       + self.privkey.x[2] * showmsg.m2)) * showmsg.P
+            let Vprime: RistrettoPoint = (self.privkey.x[0]
+                + (self.privkey.x[1] * showmsg.m1 + self.privkey.x[2] * showmsg.m2))
+                * showmsg.P
                 + self.privkey.x[3] * showmsg.Cm3
                 + self.privkey.x[4] * showmsg.Cm4
                 + self.privkey.x[5] * showmsg.Cm5
@@ -751,7 +804,7 @@ pub mod show_blind345_5 {
                     X3: &self.pubkey.X[3].compress(),
                     X4: &self.pubkey.X[4].compress(),
                     X5: &self.pubkey.X[5].compress(),
-                }
+                },
             )?;
             Ok(VerifiedCredential {
                 m1: showmsg.m1,

+ 9 - 9
tests/ggm.rs

@@ -19,15 +19,15 @@ fn create_issuer() {
 fn generator_test() {
     use hex_fmt::HexFmt;
 
-    let A : &RistrettoPoint = &CMZ_A;
-    let B : &RistrettoPoint = &CMZ_B;
+    let A: &RistrettoPoint = &CMZ_A;
+    let B: &RistrettoPoint = &CMZ_B;
     let two = Scalar::one() + Scalar::one();
     println!("A = {}", HexFmt(A.compress().to_bytes()));
     println!("B = {}", HexFmt(B.compress().to_bytes()));
-    println!("2*A = {}", HexFmt((two*A).compress().to_bytes()));
-    println!("2*A = {}", HexFmt((A+A).compress().to_bytes()));
-    println!("2*B = {}", HexFmt((two*B).compress().to_bytes()));
-    println!("2*B = {}", HexFmt((B+B).compress().to_bytes()));
+    println!("2*A = {}", HexFmt((two * A).compress().to_bytes()));
+    println!("2*A = {}", HexFmt((A + A).compress().to_bytes()));
+    println!("2*B = {}", HexFmt((two * B).compress().to_bytes()));
+    println!("2*B = {}", HexFmt((B + B).compress().to_bytes()));
 }
 
 #[test]
@@ -39,7 +39,7 @@ fn nonblind_5_test() {
     let m3 = Scalar::random(&mut rng);
     let m4 = Scalar::random(&mut rng);
     let m5 = Scalar::random(&mut rng);
-    let (req,state) = issue_nonblind_5::request(&m1, &m2, &m3, &m4, &m5);
+    let (req, state) = issue_nonblind_5::request(&m1, &m2, &m3, &m4, &m5);
     let resp = issuer.issue_nonblind_5(req);
     let result = issue_nonblind_5::verify(state, resp, &issuer.pubkey);
     assert!(result.is_ok());
@@ -54,7 +54,7 @@ fn blind124_5_test() {
     let m3 = Scalar::random(&mut rng);
     let m4 = Scalar::random(&mut rng);
     let m5 = Scalar::random(&mut rng);
-    let (req,state) = issue_blind124_5::request(&m1, &m2, &m3, &m4, &m5);
+    let (req, state) = issue_blind124_5::request(&m1, &m2, &m3, &m4, &m5);
     let resp = issuer.issue_blind124_5(req);
     assert!(resp.is_ok());
     let result = issue_blind124_5::verify(state, resp.unwrap(), &issuer.pubkey);
@@ -70,7 +70,7 @@ fn show_blind345_5_test() {
     let m3 = Scalar::random(&mut rng);
     let m4 = Scalar::random(&mut rng);
     let m5 = Scalar::random(&mut rng);
-    let (req,state) = issue_blind124_5::request(&m1, &m2, &m3, &m4, &m5);
+    let (req, state) = issue_blind124_5::request(&m1, &m2, &m3, &m4, &m5);
     let resp = issuer.issue_blind124_5(req);
     assert!(resp.is_ok());
     let result = issue_blind124_5::verify(state, resp.unwrap(), &issuer.pubkey);