From de7d1973c3ad34e22de75b729f6d1d76daa7b57c Mon Sep 17 00:00:00 2001 From: Ahmad Date: Fri, 11 Oct 2024 21:14:19 +1000 Subject: [PATCH] Formatting & CI --- .github/workflows/rust.yml | 1 + src/schnorr.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index aeccc36..8afde7d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,6 +17,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1.10.1 with: toolchain: nightly + rustflags: - name: Build run: cargo build --verbose - name: Run tests diff --git a/src/schnorr.rs b/src/schnorr.rs index d4f0574..af30086 100644 --- a/src/schnorr.rs +++ b/src/schnorr.rs @@ -53,8 +53,8 @@ impl SchnorrSigner { let mut a_copy = a; let mut res = GoldilocksField(1); let mut x_pow_2n = x.clone(); - while (a_copy > 0) { - if (a_copy % 2 != 0) { + while a_copy > 0 { + if a_copy % 2 != 0 { res *= x_pow_2n; } a_copy /= 2; @@ -101,7 +101,7 @@ impl SchnorrSigner { assert!(k < self.PRIME_GROUP_ORDER); assert!(sk.sk < self.PRIME_GROUP_ORDER); assert!(e < self.PRIME_GROUP_ORDER); - let mut s128: u128 = ((k as u128) + (sk.sk as u128) * (e as u128)); + let mut s128: u128 = (k as u128) + (sk.sk as u128) * (e as u128); s128 %= self.PRIME_GROUP_ORDER as u128; let s: u64 = s128 as u64; SchnorrSignature { e, s }