From f11fe2a92889f0760903c4182a3755dbc6f3b776 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Mon, 1 Nov 2021 17:53:01 -0700 Subject: [PATCH] fmt --- src/curve/secp256k1_curve.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/curve/secp256k1_curve.rs b/src/curve/secp256k1_curve.rs index 1e721640..7b84855b 100644 --- a/src/curve/secp256k1_curve.rs +++ b/src/curve/secp256k1_curve.rs @@ -67,15 +67,21 @@ mod tests { #[test] fn test_g1_multiplication() { - let lhs = Secp256K1Scalar::from_biguint( - BigUint::from_slice(&[1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888]) + let lhs = Secp256K1Scalar::from_biguint(BigUint::from_slice(&[ + 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, + ])); + assert_eq!( + Secp256K1::convert(lhs) * Secp256K1::GENERATOR_PROJECTIVE, + mul_naive(lhs, Secp256K1::GENERATOR_PROJECTIVE) ); - assert_eq!(Secp256K1::convert(lhs) * Secp256K1::GENERATOR_PROJECTIVE, mul_naive(lhs, Secp256K1::GENERATOR_PROJECTIVE)); } /// A simple, somewhat inefficient implementation of multiplication which is used as a reference /// for correctness. - fn mul_naive(lhs: Secp256K1Scalar, rhs: ProjectivePoint) -> ProjectivePoint { + fn mul_naive( + lhs: Secp256K1Scalar, + rhs: ProjectivePoint, + ) -> ProjectivePoint { let mut g = rhs; let mut sum = ProjectivePoint::ZERO; for limb in lhs.to_biguint().to_u64_digits().iter() {