close issue 70 and badge (#71)
* chore: fix actions badge * test: fix assertion * chore: fix array method and fmt actions
This commit is contained in:
Родитель
f30375e498
Коммит
1e60918472
|
@ -12,7 +12,7 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install
|
||||
run: rustup default stable
|
||||
run: rustup default stable
|
||||
- name: Install rustfmt Components
|
||||
run: rustup component add rustfmt
|
||||
- name: Install clippy
|
||||
|
@ -28,30 +28,21 @@ jobs:
|
|||
- name: Check clippy warnings
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
|
||||
|
||||
build_wasm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install
|
||||
run: rustup default stable
|
||||
|
||||
run: rustup default stable
|
||||
- name: Build without std
|
||||
run: cargo build --no-default-features --verbose
|
||||
|
||||
- name: Run tests without std
|
||||
run: cargo test --no-default-features --verbose
|
||||
|
||||
- name: Build examples without std
|
||||
run: cargo build --examples --no-default-features --verbose
|
||||
|
||||
- name: Install wasm32-wasi target
|
||||
run: rustup target add wasm32-wasi
|
||||
|
||||
- name: Install wasm32-unknown-unknown target
|
||||
run: rustup target add wasm32-unknown-unknown
|
||||
|
||||
- name: Build for target wasm-wasi
|
||||
run: RUSTFLAGS="" cargo build --target=wasm32-wasi --no-default-features --verbose
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Spartan: High-speed zkSNARKs without trusted setup
|
||||
|
||||
![Rust](https://github.com/microsoft/Spartan/workflows/Rust/badge.svg)
|
||||
![Rust](https://github.com/microsoft/Spartan/actions/workflows/rust.yml/badge.svg)
|
||||
[![](https://img.shields.io/crates/v/spartan.svg)](<(https://crates.io/crates/spartan)>)
|
||||
|
||||
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.
|
||||
|
|
|
@ -1234,10 +1234,8 @@ impl ProductLayerProof {
|
|||
let (row_eval_init, row_eval_read, row_eval_write, row_eval_audit) = &self.eval_row;
|
||||
assert_eq!(row_eval_write.len(), num_instances);
|
||||
assert_eq!(row_eval_read.len(), num_instances);
|
||||
let ws: Scalar = (0..row_eval_write.len())
|
||||
.map(|i| row_eval_write[i])
|
||||
.product();
|
||||
let rs: Scalar = (0..row_eval_read.len()).map(|i| row_eval_read[i]).product();
|
||||
let ws: Scalar = row_eval_write.iter().product();
|
||||
let rs: Scalar = row_eval_read.iter().product();
|
||||
assert_eq!(row_eval_init * ws, rs * row_eval_audit);
|
||||
|
||||
row_eval_init.append_to_transcript(b"claim_row_eval_init", transcript);
|
||||
|
@ -1249,10 +1247,8 @@ impl ProductLayerProof {
|
|||
let (col_eval_init, col_eval_read, col_eval_write, col_eval_audit) = &self.eval_col;
|
||||
assert_eq!(col_eval_write.len(), num_instances);
|
||||
assert_eq!(col_eval_read.len(), num_instances);
|
||||
let ws: Scalar = (0..col_eval_write.len())
|
||||
.map(|i| col_eval_write[i])
|
||||
.product();
|
||||
let rs: Scalar = (0..col_eval_read.len()).map(|i| col_eval_read[i]).product();
|
||||
let ws: Scalar = col_eval_write.iter().product();
|
||||
let rs: Scalar = col_eval_read.iter().product();
|
||||
assert_eq!(col_eval_init * ws, rs * col_eval_audit);
|
||||
|
||||
col_eval_init.append_to_transcript(b"claim_col_eval_init", transcript);
|
||||
|
@ -1262,7 +1258,7 @@ impl ProductLayerProof {
|
|||
|
||||
// verify the evaluation of the sparse polynomial
|
||||
let (eval_dotp_left, eval_dotp_right) = &self.eval_val;
|
||||
assert_eq!(eval_dotp_left.len(), eval_dotp_left.len());
|
||||
assert_eq!(eval_dotp_left.len(), eval_dotp_right.len());
|
||||
assert_eq!(eval_dotp_left.len(), num_instances);
|
||||
let mut claims_dotp_circuit: Vec<Scalar> = Vec::new();
|
||||
for i in 0..num_instances {
|
||||
|
|
Загрузка…
Ссылка в новой задаче