Add GHA test checks & clippy

This commit is contained in:
2022-10-19 21:52:58 +02:00
parent 80d97d69b5
commit 945c414283
5 changed files with 32 additions and 3 deletions

11
.github/workflows/clippy.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
name: Clippy
on: [push, pull_request]
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

14
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: Test
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: |
cargo test --verbose

View File

@@ -1,5 +1,6 @@
# ark-ec-blind-signatures
Blind signatures over elliptic curve implementation (native & r1cs gadgets) using arkworks.
# ark-ec-blind-signatures [![Test](https://github.com/aragonzkresearch/ark-ec-blind-signatures/workflows/Test/badge.svg)](https://github.com/aragonzkresearch/ark-ec-blind-signatures/actions?query=workflow%3ATest) [![Clippy](https://github.com/aragonzkresearch/ark-ec-blind-signatures/workflows/Clippy/badge.svg)](https://github.com/aragonzkresearch/ark-ec-blind-signatures/actions?query=workflow%3AClippy)
Blind signatures over elliptic curve implementation (native & r1cs constraints) using arkworks.
[Blind signature](https://en.wikipedia.org/wiki/Blind_signature) over elliptic curves, based on *"[New Blind Signature Schemes Based on the (Elliptic Curve) Discrete Logarithm Problem](https://sci-hub.st/10.1109/iccke.2013.6682844)"* paper by Hamid Mala & Nafiseh Nezhadansari.

View File

@@ -89,6 +89,7 @@ where
// let s = val.borrow().s;
let mut s = Vec::<UInt8<ConstraintF<C>>>::new();
let s_bytes = to_bytes![val.borrow().s].unwrap();
#[allow(clippy::needless_range_loop)]
for i in 0..s_bytes.len() {
s.push(UInt8::<ConstraintF<C>>::new_variable(
cs.clone(),
@@ -236,6 +237,7 @@ where
SignatureVar::<C, GC>::new_witness(ark_relations::ns!(cs, "signature"), || {
self.signature.ok_or(SynthesisError::AssignmentMissing)
})?;
#[allow(clippy::redundant_clone)]
let poseidon_hash = PoseidonGadget::<ConstraintF<C>>::from_native(
&mut cs.clone(),
self.poseidon_hash_native,

View File

@@ -136,8 +136,9 @@ where
<C as ProjectiveCurve>::ScalarField: From<BigInteger256>,
{
let u = Self::new_blind_params(parameters, rng, signer_r);
// get X coordinate, as in new_blind_params we already checked that R.x is inside Fr and
// will not give None
// will not overflow (giving None)
let r = EdwardsAffine::from(u.r); // WIP
let x_fr = C::ScalarField::from(r.x.into_repr());