Skip to content

Commit

Permalink
use correct num of trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Aug 25, 2023
1 parent 21a91c7 commit 8e8bf6d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/crs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use ark_std::rand::{rngs::StdRng, RngCore, SeedableRng};
use curdleproofs::{
crs::{CurdleproofsCrs, CurdleproofsCrsHex, CRS_EXTRA_POINTS},
whisk::{generate_whisk_shuffle_proof, is_valid_whisk_shuffle_proof, WhiskTracker},
N_BLINDERS,
};
use sha2::{Digest, Sha256};

Expand Down Expand Up @@ -49,7 +50,7 @@ fn generate_random_points(num_points: usize, seed: &str) -> (Vec<G1Affine>, u64)
}

#[test]
fn ethereum_crs_128() {
fn ethereum_crs_128_seed() {
let n = 128;
let (points, increment) =
generate_random_points(n + CRS_EXTRA_POINTS, "nankokita_no_kakurenbo");
Expand All @@ -66,16 +67,12 @@ fn ethereum_crs_128() {
}

#[test]
fn ethereum_crs_test() {
fn ethereum_crs_128_unsafe_rand() {
let n = 128;
let crs = CurdleproofsCrs::generate_crs(n).unwrap(); // Note that +CRS_EXTRA_POINTS is done inside.

// Check CRS works
test_crs(&crs, n);

let out =
serde_json::to_string_pretty::<CurdleproofsCrsHex>(&(&crs).try_into().unwrap()).unwrap();
println!("{}", out);
}

fn test_crs(crs: &CurdleproofsCrs, n: usize) {
Expand All @@ -98,5 +95,7 @@ fn generate_shuffle_trackers<T: RngCore>(
rng: &mut T,
n: usize,
) -> Result<Vec<WhiskTracker>, SerializationError> {
(0..n).map(|_| WhiskTracker::from_rand(rng)).collect()
(0..n - N_BLINDERS)
.map(|_| WhiskTracker::from_rand(rng))
.collect()
}

0 comments on commit 8e8bf6d

Please sign in to comment.