Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin-Ray committed Oct 3, 2024
1 parent f085360 commit fc883da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/proof-of-sql/src/proof_primitive/dory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type GT = ark_ec::pairing::PairingOutput<ark_bls12_381::Bls12_381>;
mod rand_util;
#[cfg(test)]
use rand_util::rand_F_tensors;
#[cfg(any(test, feature = "test"))]
#[cfg(test)]
use rand_util::rand_G_vecs;
#[cfg(any(test, feature = "test"))]
pub use rand_util::test_rng;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use core::iter;

use super::{G1Affine, G2Affine};
use alloc::vec::Vec;
use ark_ff::UniformRand;
#[cfg(not(any(test, feature = "test")))]
use ark_std::rand::CryptoRng;
use ark_std::rand::Rng;
use ark_std::rand::{CryptoRng, Rng};
use core::iter;

/// The public parameters for the Dory protocol. See section 5 of https://eprint.iacr.org/2020/1274.pdf for details.
///
/// Note: even though H_1 and H_2 are marked as blue, they are still needed.
Expand All @@ -27,9 +25,8 @@ pub struct PublicParameters {
}

impl PublicParameters {
#[cfg(not(any(test, feature = "test")))]
/// Generate cryptographically secure random public parameters.
pub fn rand<R: CryptoRng + Rng + ?Sized>(max_nu: usize, rng: &mut R) -> Self {
pub fn crypto_rand<R: CryptoRng + Rng + ?Sized>(max_nu: usize, rng: &mut R) -> Self {
Self::rand_impl(max_nu, rng)
}
#[cfg(any(test, feature = "test"))]
Expand Down
1 change: 1 addition & 0 deletions crates/proof-of-sql/src/proof_primitive/dory/rand_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub fn test_seed_rng(seed: [u8; 32]) -> impl Rng {
StdRng::from_seed(seed)
}

#[allow(dead_code)]
/// Creates two vectors of random G1 and G2 elements with length 2^nu.
pub fn rand_G_vecs<R>(nu: usize, rng: &mut R) -> (Vec<G1Affine>, Vec<G2Affine>)
where
Expand Down

0 comments on commit fc883da

Please sign in to comment.