Skip to content

Commit 1e60918

Browse files
authored
close issue 70 and badge (#71)
* chore: fix actions badge * test: fix assertion * chore: fix array method and fmt actions
1 parent f30375e commit 1e60918

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

.github/workflows/rust.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: Install
15-
run: rustup default stable
15+
run: rustup default stable
1616
- name: Install rustfmt Components
1717
run: rustup component add rustfmt
1818
- name: Install clippy
@@ -28,30 +28,21 @@ jobs:
2828
- name: Check clippy warnings
2929
run: cargo clippy --all-targets --all-features -- -D warnings
3030

31-
32-
3331
build_wasm:
3432
runs-on: ubuntu-latest
3533
steps:
3634
- uses: actions/checkout@v2
37-
3835
- name: Install
39-
run: rustup default stable
40-
36+
run: rustup default stable
4137
- name: Build without std
4238
run: cargo build --no-default-features --verbose
43-
4439
- name: Run tests without std
4540
run: cargo test --no-default-features --verbose
46-
4741
- name: Build examples without std
4842
run: cargo build --examples --no-default-features --verbose
49-
5043
- name: Install wasm32-wasi target
5144
run: rustup target add wasm32-wasi
52-
5345
- name: Install wasm32-unknown-unknown target
5446
run: rustup target add wasm32-unknown-unknown
55-
5647
- name: Build for target wasm-wasi
5748
run: RUSTFLAGS="" cargo build --target=wasm32-wasi --no-default-features --verbose

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Spartan: High-speed zkSNARKs without trusted setup
22

3-
![Rust](https://github.com/microsoft/Spartan/workflows/Rust/badge.svg)
3+
![Rust](https://github.com/microsoft/Spartan/actions/workflows/rust.yml/badge.svg)
44
[![](https://img.shields.io/crates/v/spartan.svg)](<(https://crates.io/crates/spartan)>)
55

66
Spartan is a high-speed zero-knowledge proof system, a cryptographic primitive that enables a prover to prove a mathematical statement to a verifier without revealing anything besides the validity of the statement. This repository provides `libspartan,` a Rust library that implements a zero-knowledge succinct non-interactive argument of knowledge (zkSNARK), which is a type of zero-knowledge proof system with short proofs and fast verification times. The details of the Spartan proof system are described in our [paper](https://eprint.iacr.org/2019/550) published at [CRYPTO 2020](https://crypto.iacr.org/2020/). The security of the Spartan variant implemented in this library is based on the discrete logarithm problem in the random oracle model.

src/sparse_mlpoly.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -1234,10 +1234,8 @@ impl ProductLayerProof {
12341234
let (row_eval_init, row_eval_read, row_eval_write, row_eval_audit) = &self.eval_row;
12351235
assert_eq!(row_eval_write.len(), num_instances);
12361236
assert_eq!(row_eval_read.len(), num_instances);
1237-
let ws: Scalar = (0..row_eval_write.len())
1238-
.map(|i| row_eval_write[i])
1239-
.product();
1240-
let rs: Scalar = (0..row_eval_read.len()).map(|i| row_eval_read[i]).product();
1237+
let ws: Scalar = row_eval_write.iter().product();
1238+
let rs: Scalar = row_eval_read.iter().product();
12411239
assert_eq!(row_eval_init * ws, rs * row_eval_audit);
12421240

12431241
row_eval_init.append_to_transcript(b"claim_row_eval_init", transcript);
@@ -1249,10 +1247,8 @@ impl ProductLayerProof {
12491247
let (col_eval_init, col_eval_read, col_eval_write, col_eval_audit) = &self.eval_col;
12501248
assert_eq!(col_eval_write.len(), num_instances);
12511249
assert_eq!(col_eval_read.len(), num_instances);
1252-
let ws: Scalar = (0..col_eval_write.len())
1253-
.map(|i| col_eval_write[i])
1254-
.product();
1255-
let rs: Scalar = (0..col_eval_read.len()).map(|i| col_eval_read[i]).product();
1250+
let ws: Scalar = col_eval_write.iter().product();
1251+
let rs: Scalar = col_eval_read.iter().product();
12561252
assert_eq!(col_eval_init * ws, rs * col_eval_audit);
12571253

12581254
col_eval_init.append_to_transcript(b"claim_col_eval_init", transcript);
@@ -1262,7 +1258,7 @@ impl ProductLayerProof {
12621258

12631259
// verify the evaluation of the sparse polynomial
12641260
let (eval_dotp_left, eval_dotp_right) = &self.eval_val;
1265-
assert_eq!(eval_dotp_left.len(), eval_dotp_left.len());
1261+
assert_eq!(eval_dotp_left.len(), eval_dotp_right.len());
12661262
assert_eq!(eval_dotp_left.len(), num_instances);
12671263
let mut claims_dotp_circuit: Vec<Scalar> = Vec::new();
12681264
for i in 0..num_instances {

0 commit comments

Comments
 (0)