chore: init versionA crate

This commit is contained in:
Magamedrasul Ibragimov
2023-04-12 14:25:31 +04:00
parent bac20fa0f0
commit 45d7d2ed19
3 changed files with 67 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
target
Cargo.lock

11
versionA/Cargo.toml Normal file
View File

@@ -0,0 +1,11 @@
[package]
name = "versionA"
version = "0.1.0"
edition = "2021"
[dependencies]
ark-poly-commit = "0.3.0"
ark-ec = "0.3.0"
ark-bls12-381 = "0.3.0"
ark-std = "0.3.0"
ark-poly = "0.3.0"

54
versionA/src/main.rs Normal file
View File

@@ -0,0 +1,54 @@
use std::collections::HashMap;
use ark_bls12_381::*;
use ark_ec::{bls12::Bls12, PairingEngine};
use ark_poly::univariate::DensePolynomial;
use ark_poly_commit::kzg10::*;
use ark_std::test_rng;
type UniPoly_381 = DensePolynomial<<Bls12_381 as PairingEngine>::Fr>;
struct RLN {
limit: u8,
trusted_setup_params: UniversalParams<Bls12<Parameters>>,
}
impl RLN {
fn new(limit: u8) -> Self {
let rng = &mut test_rng();
let trusted_setup_params =
KZG10::<Bls12_381, UniPoly_381>::setup(limit as usize, false, rng)
.expect("Setup failed");
Self {
limit,
trusted_setup_params,
}
}
}
struct User {}
impl User {
fn new() -> Self {
Self {}
}
fn send(&self, message: &str) {
todo!()
}
}
fn main() {
let rln = RLN::new(1);
let user = User::new();
// user.send("Hello");
// user.send("I'm spammer");
let rng = &mut test_rng();
let trusted_setup_params =
KZG10::<Bls12_381, UniPoly_381>::setup(1, false, rng).expect("Setup failed");
println!("{:#?}", trusted_setup_params);
}