Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnaucube/ipa-rs
modified Inner Product Argument version from Halo paper
https://github.com/arnaucube/ipa-rs
Last synced: 2 months ago
JSON representation
modified Inner Product Argument version from Halo paper
- Host: GitHub
- URL: https://github.com/arnaucube/ipa-rs
- Owner: arnaucube
- License: gpl-3.0
- Created: 2022-07-07T18:45:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-07T07:59:12.000Z (almost 2 years ago)
- Last Synced: 2024-04-16T22:33:55.614Z (9 months ago)
- Language: Rust
- Homepage:
- Size: 16.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ipa-rs [![Test](https://github.com/arnaucube/ipa-rs/workflows/Test/badge.svg)](https://github.com/arnaucube/ipa-rs/actions?query=workflow%3ATest)
Inner Product Argument (IPA) version from Halo paper (https://eprint.iacr.org/2019/1021.pdf) implementation done to get familiar with [arkworks](https://arkworks.rs) and the modified IPA scheme.
> Warning: do not use this code in production.
### Example
```rust
let mut ipa = IPA::new(8);let a = vec![
F::from(1 as u32),
F::from(2 as u32),
F::from(3 as u32),
F::from(4 as u32),
F::from(5 as u32),
F::from(6 as u32),
F::from(7 as u32),
F::from(8 as u32),
];let r = F::rand(&mut ipa.rng);
// prover commits
let P = ipa.commit(&a, r).unwrap();// verifier sets challenges
let U = EdwardsProjective::rand(&mut ipa.rng);
let k = (f64::from(ipa.d as u32).log2()) as usize;
let mut u: Vec = vec![F::zero(); k];
for j in 0..k {
u[j] = F::rand(&mut ipa.rng);
}
let x = F::from(3 as u32);// prover opens at the challenges
let b = powers_of(x, ipa.d);
let v = inner_product_field(&a, &b).unwrap();
let proof = ipa.prove(&a, &b, &u, &U).unwrap();// verifier
let verif = ipa.verify(&x, &v, &P, &proof, &r, &u, &U).unwrap();
assert!(verif);
```